Problem list
Log in
#coci00062 · COCI 2007/2008 Contest 5

Pascal

Silver III 1.0 s 32 MB

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 line of input contains the integer $N$ ($1 \le N \le 10^9$).

Output

Output the result on a single line.

Example 1

Input
1
Output
0

Example 2

Input
10
Output
5

Example 3

Input
27
Output
18
Source
COCI 2007/2008 Contest 5
Appears in
Not part of a ladder, contest or set yet.
Accepted 1 Submissions 1 Acceptance 100% Solvers 1

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code