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.
InputThe first line of input contains the integer N (1 ≤ N ≤ 109).
OutputOutput the result on a single line.
Input
1 Output
0
Input
Output
10 Output
5Input
Output
27 Output
18Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.