d = [int(s) for s in input().split()] n = d[0] + d[1] if d[0] == 4 and d[1] == 1: n += 1 print(n)