#include <iostream> using namespace std; int euler(int n) { int res = n; for (int i = 2; i <= n; i++) { if (n % i == 0) { res = res/i*(i-1); while (n % i == 0) { n /= i; } } } return res; } int main() { int n; cin >> n; cout << euler(n) << endl; return 0; }