x, y = map(int, input().split()) z = (max(x, y) + 4) % 12 print(z)