import java.util.Scanner;
import java.math.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
Long number = scan.nextLong();
// 使用BigInteger类的工具方法
boolean flag = BigInteger.valueOf(number).isProbablePrime(100);
System.out.println(flag);
}
}