c=input().split() idx=c.index('?') if idx==1: print(14) else: if c[1]=='2': print(4) else: print(1)