_,a,_=input().split() print(14 if a=='?' else [1,4][a=='2'])