题目描述
Problem Description
Little Frane is in the tenth grade, but he still struggles with learning Pascal in his computer science class. The teacher has written the following Pascal program as homework, and he needs to determine the output of the program based on the input integer \( N \).
readln(N);
counter := 0;
for i := N-1 downto 1 do begin
counter := counter + 1;
if N mod i = 0 then break;
end;
writeln(counter);
Please write a program to solve this problem.
Input Format
A single line containing an integer \( N \).
Output Format
A single line representing the output of the above program.
Sample Input and Output
Sample Input #1
1
Sample Output #1
0
Sample Input #2
10
Sample Output #2
5
Sample Input #3
27
Sample Output #3
18
Notes
For \( 100\% \) of the test cases, \( 1 \le N \le 10^9 \).
This problem is scored according to the original competition settings, with a maximum of \( 30 \) points.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分
样例输入
1
样例输出
0