import math
import sys
# x,y=list(map(int,input().split()))
# n=int(input())
def zs(n):
    if n==1:
        return 0
    elif n==2:
        return 1
    else:
        for i in range(2,int(n**0.5)+1):
            if n%i ==0:
                return 0
        return 1
def hs(i):
    return pow(2,pow(2,i))+1
i=0
while zs(hs(i))==1:
    i=i+1
print(i)

/**************************************************************
	Problem: 1352
	User: admin
	Language: Python
	Result: Accepted
	Time:52 ms
	Memory:34480 kb
****************************************************************/