a, b = map(int, input().split())
year = a // 10000
if b < 3:
    result = 112 - year + 1
elif b < 5:
    result = 12 - year + 1
print(result)

ebc4412e06c6cac0c0fb62f9dbdfdf6ff5da37f2
<mask token>

<mask token>
if b < 3:
    result = 112 - year + 1
elif b < 5:
    result = 12 - year + 1
print(result)

a, b = map(int, input().split())
year = a // 10000
if b < 3:
    result = 112 - year + 1
elif b < 5:
    result = 12 - year + 1
print(result)
