c = input().split() q = c.index('?') if q == 0: a = int(c[1]) b = int(c[2]) if a < b: print('4') else: print('1') elif q == 1: a = int(c[0]) b = int(c[2]) print('14') else: a = int(c[0]) b = int(c[1]) if a < b: print('1') else: print('4')