c = [x for x in input().split()] if c[1] == "?": print("14") elif c[1] == "2": print("4") elif c[1] == "3": print("1")