P26734 [AtCoder] Digit Sum
提高-
题目描述

Problem Description

JOI-kun initially had an integer between $1$ and $N$ inclusive. JOI-kun performed the following operation zero or more times, and as a result, the integer he had became $N$.

  • Add the sum of the digits of the integer (when expressed in base 10) to the integer itself.

Given $N$, create a program that determines the number of possible integers JOI-kun could have initially had.

Input Format

The input is given from the standard input in the following format:

$ N $

Output Format

Output the number of possible integers JOI-kun could have initially had in one line.

Sample Input and Output

Sample Input #1

13

Sample Output #1

4

Sample Input #2

20

Sample Output #2

1

Sample Input #3

2019

Sample Output #3

449

Notes/Hints

Constraints

  • $1 \leq N \leq 1,000,000$.
  • $ N $ is an integer.

Sample Explanation 1

For example, if JOI-kun initially had the integer $5$ and performed the operation 3 times, the integer would change as follows: $5 \rightarrow 10 \rightarrow 11 \rightarrow 13$. The possible integers JOI-kun could have initially had are $5, 10, 11, 13$, which are 4 in total.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
13
样例输出
4