#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> prime, v;
bool check[1000010];
bool color[1000010];
void init() {
  for (long long i = 2; i < 1000010; i++) {
    for (long long j = i * i; j < 1000010; j += i) {
      check[j] = true;
    }
  }
  for (int i = 2; i < 1000010; i++)
    if (!check[i]) prime.push_back(i);
}
bool isprime(int pp) {
  for (int i = 0; i < prime.size(); i++) {
    if (pp == 1) return false;
    if (pp < prime[i]) return true;
    if (pp % prime[i] == 0) return false;
  }
}
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  init();
  cin >> n;
  int flag = 0;
  long long mn = 0;
  for (long long i = prime.size() - 1; i >= 0; i--) {
    if (n % prime[i] == 0) {
      v.push_back(prime[i]);
      if (isprime(n / prime[i])) v.push_back(n / prime[i]);
      mn = prime[i];
    }
  }
  if (v.empty())
    cout << n;
  else {
    int res = 1;
    for (long long i : v) {
      long long p = i;
      for (long long j = 1; j <= mn; j++) {
        color[(p * j) % mn] = true;
      }
    }
    for (int i = 0; i < mn; i++)
      if (!color[i]) res++;
    cout << res;
  }
  return 0;
}
