It's worth thinking a bit,
See, in n-digit number each place has 3 options only,i.e, 2,5 and 7.
so, for a 3 digit number u'll have how much possible numbers: 3*3*3 = 3^3
for an n-digit number, we'll have 3^n numbers possible.
so, all what we need is : 3^n >= 900.
i hope now you can easily find n. :)