# No.632 穴埋め門松列 c = [i for i in input().split()] if c[1] == '2': print(4) elif c[1] == '3': print(1) else: print(14)