No.671 1000000007
タグ : / 解いたユーザー数 600
作問者 :
nmnmnmnmnmnmnm
/ テスター :
👑 Problem Statement
A-kun tried to type the number 1000000007.
However, A-kun mistakenly typed the wrong number of '0's between the '1' and the '7'.
Given the value $N$ that A-kun typed, answer how much its number of 0s differs from that of 1000000007.
Input
$N$
$N$ is a positive integer whose number of 0s differs from that of 1000000007. $100 \le N \le 1000000000000000$.
When viewed as a string, $N$ begins with '1' and ends with '7'. All characters between them are '0'.
Output
Output in one line how much the number of 0s differs from that of 1000000007. Print a newline at the end.
Sample
Sample 1
Input
100000007
Output
1
There is one 0 too few. Therefore, the answer is 1.
Sample 2
Input
100000000007
Output
2
There are two 0s too many. Therefore, the answer is 2.
Sample 3
Input
100000000000007
Output
5
This is the test case with the largest $N$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。