c1, c2, c3 = input().split(' ') print('14' if c2 == '?' else '4' if c2 == '2' else '1')