a = [0,31,29,31,30,31,30,31,31,30,31,30,31] n = int(input()) if 1<=n<=12: print(a[n]) else: print("Invalid.")