#include <bits/stdc++.h>
using namespace std;
long long n;
//chuongtrinhcon
bool ktnt(long long n)
{
if (n<2) return(false);
else
for (int i=2; i*i<=n;i++)
if (n%i==0) return (false);
return(true);
}
//chuongtrinhchinh
int main()
{
//freopen("KTSNT.INP","r",stdin);
//freopen("KTSNT.OUT","w",stdout);
cin>>n;
if (ktnt(n)==true) cout<<"1";
else cout<<"0";
return 0;
}