x, y = map(int, input().split()) y += y - x print(y % 12)