a, b, c = input().split() if a !="?" and c != "?": print("14") elif b != "?" and c != "?": if int(b) < int(c): print("4") else: print("1") elif a != "?" and b != "?": if int(a) > int(b): print("4") else: print("1")