P26841 [AtCoder] Hihumi
普及
题目描述

Problem Description

Takahashi Hifumi-kun was teased by his classmates because his real name contains "123". Since then, he has grown to dislike the integer "123". Therefore, when counting integers in order from "1, 2, 3, 4, ...", he always skips the number $123$. How many integers will he say when counting from $1$ to $N$?

Input Format

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

$ N $

Output Format

Output the number of integers he will say in one line.
End with a newline.

Sample Input and Output

Sample Input #1

10

Sample Output #1

10

Sample Input #2

124

Sample Output #2

123

Sample Input #3

1000

Sample Output #3

999

Notes/Hints

Constraints

  • $ N $ is an integer between $1$ and $1,000$ (inclusive) and is not $123$.

Subtasks

Subtask $1$ \[$40$ points\]

  • Satisfies $N \leq 10$.

Subtask $3$ \[$60$ points\]

  • No additional constraints.

Sample Explanation 1

For $ N = 10 $, he counts normally as $1 \rightarrow 2 \rightarrow 3 \rightarrow 4 \rightarrow 5 \rightarrow 6 \rightarrow 7 \rightarrow 8 \rightarrow 9 \rightarrow 10$. Therefore, Takahashi-kun says $10$ numbers.

Sample Explanation 2

For $ N = 124 $, he counts as $1 \rightarrow 2 \rightarrow ... \rightarrow 121 \rightarrow 122 \rightarrow 124$, resulting in a total of $123$ numbers being said.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
10
样例输出
10