I'm really stuck on this problem.

It says,how many numbers between 1 and 999,999 contains each of the digit 1,2 and 3 at least once.(Hint : for each i = 1,2,3 A_i be the set of all integers from 1 to 999,999 that do not contain the digit i)

I really need help with this one.