Author:  Антон Карабанов  Time limit:  1 sec  
Input file:  Standard input  Memory limit:  256 Mb  
Output file:  Standard output 
Astrologer Timofey considers a year to be happy if different consecutive digits are used in its notation. For example, the nearest such year will occur in 2031. Determine, by the year number, how many years it will take for a happy year to come?
The input consists of a single line containing a natural number n — the year number.
Output a single nonnegative integer — the answer to the problem.
1 ≤ n ≤ 9876543210
No.  Standard input  Standard output 

1 


2 

