N = input() M = N.split() P = [I for I in M] if P[1] == '2': print("4") elif P[1] == '3': print("1") else: print("14")