import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) A = [ 0,0,0,0,3,0,5,0,7,7, # 0 ~ 9 7,0,11,0,13,7,7,0,8,0, # ~19 19,19,7,0,23,23,8,8,8 ] answer = A[N] if N < 30 else 8 print(answer)