문제1305--Relatives

1305: Relatives

실행시간 제한: 1 Sec  메모리사용 제한: 66 MB
제출: 33  통과: 16
[제출] [채점기록] [묻고답하기]

문제 설명

Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a = xy and b = xz.

입력 설명

There are several test cases. For each test case, standard input contains a line with n <= 1,000,000,000. A line containing 0 follows the last case.

출력 설명

For each test case there should be single line of output answering the question posed above.

입력 예시 Copy

7
12
0

출력 예시 Copy

6
4

출처/분류