C = input().split() qpos = C.index('?') if qpos == 0: if C[1] < C[2]: print(4) if C[1] > C[2]: print(1) elif qpos == 1: print(14) elif qpos == 2: if C[0] < C[1]: print(4) if C[0] > C[1]: print(1)