#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n < 2) return false;
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    int r = 0;
    r += isPrime(n);
    cout << r << endl;
  }
  return 0;
}
