a = input().split() if a[1] == "?": print(14) elif a[1] == "2": print(4) else: print(1)