102
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
 
using namespace std;
 
typedef vector<int> vi; 
typedef vector<string> vs;
typedef vector<vi> vvi; 
typedef pair<int,int> ii; 
#define sz(a) int((a).size()) 
#define pb push_back 
#define all(c) (c).begin(),(c).end() 
//#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++) 
#define present(c,x) ((c).find(x) != (c).end()) 
#define cpresent(c,x) (find(all(c),x) != (c).end()) 
#define FOR(_i,_n) for(int (_i) = 0; (_i) < (_n); (_i)++)
 
#define INPUT_FILE "xo.in"
#define OUTPUT_FILE "xo.out"
 
int main()
{
#ifdef ALEX
    freopen("input.in", "r", stdin);
    freopen("output.out", "w", stdout);
#else
//    freopen(INPUT_FILE, "r", stdin);
//    freopen(OUTPUT_FILE, "w", stdout);
#endif
 
    int n;
    int i = 2;
    map< int, int > m;
 
    cin >> n;
    long long pp = n;
    while( n != 1 )
    {
        if( i >= ((int)sqrt((double)n) + 1) )
        {
            m[n] = 1;
            break;
        }
 
        while( n % i == 0 )
        {
            m[i] = 1;
            n = n/i;
        }
        i++;
    }
 
    long long p = 1;
 
    for(map<int,int>::iterator it = m.begin(); it != m.end(); it++)
    {
        p *= ((*it).first - 1);
        pp /= (*it).first;
    }
 
    cout << pp*p;
 
    return 0;
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.