Co-prime Numbers

3.5

2 votes
Easy
Problem

Question:

You are provided with a number N as a input and you need to print total number of co-prime numbers to N which are less than N.

Input:

First and only line of input contains integer N.

Output:

Print total number of co-primes number to N which are less than N.

Constraints:

N is positive integer less than 10000000.

Time Limit: 0.111
Memory Limit: 256
Source Limit:
Explanation

For N = 10 co-prime numbers are 1, 3, 7, 9 hence output is 4

Editor Image

?