c = input().split()[1] print(4 if c == "2" else 1 if c == "3" else 14)