Problem

Source: St. Petersburg MO 2001, 10th grade, P2

Tags: algebra, combinatorics, Operation



The computer "Intel stump-V" can do only one operation with a number: add 1 to it, then rearrange all the zeros in the decimal representation to the end and rearrenge the left digits in any order. (For example from 1004 you could get 1500 or 5100). The number $12345$ was written on the computer and after performing 400 operations, the number 100000 appeared on the screen. How many times has a number with the last digit 0 appeared on the screen?