LTAI-21-11-28 Practice

Start

2021-11-25 03:00 AKST

LTAI-21-11-28 Practice

End

2021-12-01 09:00 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -60 days 8:51:01

Time elapsed

150:00:00

Time remaining

0:00:00

Problem I
Pascal

Little Frane is already in tenth grade, but is still struggling with Pascal in computer class. For homework, his teacher wrote the following program into his notebook, and he needs to determine the output, given the 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);

Write a program which solves Frane’s problem.

Input

The first and only line of input contains the integer $1 \le N \le 10^9$.

Output

Output the result from Frane’s program on a single line.

Sample Input 1 Sample Output 1
1
0
Sample Input 2 Sample Output 2
10
5
Sample Input 3 Sample Output 3
27
18