#include <bits/stdc++.h>
using namespace std;
double primptive(int n) {
  double r = n;
  if (n == 1) return 1;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
      }
      r *= (1 - (1.0 / i));
    }
  }
  if (n > 1) r *= (1 - (1.0 / n));
  return r;
}
int main() {
  int n;
  cin >> n;
  cout << primptive(n - 1) << endl;
  ;
  return 0;
}
