2016 AIME I Problem 8

For a permutation p=\left(a_{1}, a_{2}, \ldots, a_{9}\right) of the digits 1,2, \ldots, 9, let s(p) denote the sum of the three 3 -digit numbers a_{1} a_{2} a_{3}, a_{4} a_{5} a_{6}, and a_{7} a_{8} a_{9}. Let m be the minimum value of s(p) subject to the condition that the units digit of s(p) is 0 . Let n denote the number of permutations p with s(p)=m. Find |m-n|.