Vasya calculates the sum 2+22+202+2002+...20...02 and wants to see his lucky four-digit number $$$N$$$ among the consecutive digits of the resulting sum. Help Vasya determine the minimum number of summands he needs to take in order to have a fragment in the decimal representation of the sum that coincides with his lucky number $$$N$$$.
An integer $$$N$$$ is entered ($$$1000 \le N \le 9999$$$).
Output the minimum number of summands whose sum will allow Vasya to see a fragment in the form of his lucky number, if possible. Otherwise, output -1.
2230
5
2023
49005
| Name |
|---|


