# coding: utf-8 a, b, c = map(str, input().split()) if a == '?' or c == '?': if b == '2': print(4) else: print(1) else: print(14)