PivotOJ

PASCAL

시간 제한: 1000ms메모리 제한: 128MB출처: COCI 2007-2008BOJ 2986

문제

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. 

입력

The first line of input contains the integer N (1 ≤ N ≤ 109).

출력

Output the result on a single line. 

예제

예제 1

입력
1
출력
0

예제 2

입력
10
출력
5

예제 3

입력
27
출력
18
코드를 제출하려면 로그인하세요.