m, d = map(int, input().split()) if m == 4 and d == 1: print(6) else: print(m + d)