since, I can't help you directly, let me give you a hint...

the first thing you can do is to separate all the digits in the number and store them...