#include <iostream>
#include <math.h>
using namespace std;
int main() {
float o ,s ,d = 0 ;
int a;
cin >> o;
a = o;
s = sqrt(o);
for(int t = 3 ; t < s ; t = t + 2){
if(a % 2 == 0){
d = 1;
break;
}
d = 0;
if(a % t != 0){
continue;
}else if (a % t == 0){
d = 1;
break;
}
}
if(d == 1){
cout << "非質數" <<'\n';
}else{
cout << "質數" << '\n';
}
}