The cows have just learned what a primitive root is! Given a prime *p*, a primitive root <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/f203bd9f1553a2d666452cec7d6f1f4f02a817fb.png" style="max-width: 100.0%;max-height: 100.0%;"/> is an integer *x* (1 ≤ *x* &lt; *p*) such that none of integers *x* - 1, *x*<sup class="upper-index">2</sup> - 1, ..., *x*<sup class="upper-index">*p* - 2</sup> - 1 are divisible by *p*, but *x*<sup class="upper-index">*p* - 1</sup> - 1 is. 

Unfortunately, computing primitive roots can be time consuming, so the cows need your help. Given a prime *p*, help the cows find the number of primitive roots <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/f203bd9f1553a2d666452cec7d6f1f4f02a817fb.png" style="max-width: 100.0%;max-height: 100.0%;"/>.
The input contains a single line containing an integer *p* (2 ≤ *p* &lt; 2000). It is guaranteed that *p* is a prime.
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <utility>
#include <iterator>
#include <type_traits>
#include <numeric>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <tuple>
#include <list>
#include <map>
#include <iomanip>

using namespace std;
auto inf = numeric_limits<int>::max();

#define trace(...) cout << "Line " << __LINE__ << ": "; __f(#__VA_ARGS__, __VA_ARGS__); cout << endl;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << ": " << arg1 << '\n';
}

template <typename Arg1, typename ... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << ": " << arg1 <<" |"; __f(comma+1, args ...);
}

template <typename T, typename U>
ostream& operator<<(ostream &os, pair<T, U> p) {
  return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream &os, vector<T> container) {
  os << "{";
  for (T elem: container) {
    os << elem << ", ";
  } os << (container.empty() ? "}" : "\b\b}");
  return os;
}

template <typename T>
ostream& operator<<(ostream &os, set<T> container) {
  os << "{";
  for (T elem: container) {
    os << elem << ", ";
  } os << (container.empty() ? "}" : "\b\b}");
  return os << endl;
}

void start(int debug=0) {
  ios_base::sync_with_stdio(false), cin.tie(0);
  if (debug) {
    freopen("input.txt", "r", stdin);
    if (debug == 2) {
      freopen("output.txt", "w", stdout);
    }
  }
}

int powmod (int a, int b, int p) {
    int res = 1;
    while (b)
        if (b & 1)
            res = int (res * 1ll * a % p),  --b;
        else
            a = int (a * 1ll * a % p),  b >>= 1;
    return res;
}

map<int, int> factorize(int n) {
  map<int, int> fact;
  for (int d = 2; d*d <= n; d++) {
    while (n%d == 0) {
      n /= d;
      fact[d]++;
    }
  } if (n > 1) fact[n] = 1;
  return fact;
}

int phi(int n) {
  double res = n;
  for (auto pc: factorize(n)) {
    double p = pc.first;
    res *= (1-1/p);
  } return res;
}

int main() {
  start();
  int p;
  cin >> p;
  cout << phi(phi(p)) << endl;
}
