a, b = [int(v) for v in input().split()] print(((a + b) // 2 + 6) % 12)