Not so long ago the Codecraft-17 contest was held on Codeforces. The top 25 participants, and additionally random 25 participants out of those who got into top 500, will receive a Codeforces T-shirt.

Unfortunately, you didn't manage to get into top 25, but you got into top 500, taking place p.

Now the elimination round of 8VC Venture Cup 2017 is being held. It has been announced that the Codecraft-17 T-shirt winners will be chosen as follows. Let s be the number of points of the winner of the elimination round of 8VC Venture Cup 2017. Then the following pseudocode will be executed: 

i := (s div 50) mod 475

repeat 25 times:

    i := (i * 96 + 42) mod 475

    print (26 + i)



Here "div" is the integer division operator, "mod" is the modulo (the remainder of division) operator.

As the result of pseudocode execution, 25 integers between 26 and 500, inclusive, will be printed. These will be the numbers of places of the participants who get the Codecraft-17 T-shirts. It is guaranteed that the 25 printed integers will be pairwise distinct for any value of s.

You're in the lead of the elimination round of 8VC Venture Cup 2017, having x points. You believe that having at least y points in the current round will be enough for victory.

To change your final score, you can make any number of successful and unsuccessful hacks. A successful hack brings you 100 points, an unsuccessful one takes 50 points from you. It's difficult to do successful hacks, though.

You want to win the current round and, at the same time, ensure getting a Codecraft-17 T-shirt. What is the smallest number of successful hacks you have to do to achieve that?


-----Input-----

The only line contains three integers p, x and y (26 ≤ p ≤ 500; 1 ≤ y ≤ x ≤ 20000) — your place in Codecraft-17, your current score in the elimination round of 8VC Venture Cup 2017, and the smallest number of points you consider sufficient for winning the current round.


-----Output-----

Output a single integer — the smallest number of successful hacks you have to do in order to both win the elimination round of 8VC Venture Cup 2017 and ensure getting a Codecraft-17 T-shirt.

It's guaranteed that your goal is achievable for any valid input data.


-----Examples-----
Input
239 10880 9889

Output
0

Input
26 7258 6123

Output
2

Input
493 8000 8000

Output
24

Input
101 6800 6500

Output
0

Input
329 19913 19900

Output
8



-----Note-----

In the first example, there is no need to do any hacks since 10880 points already bring the T-shirt to the 239-th place of Codecraft-17 (that is, you). In this case, according to the pseudocode, the T-shirts will be given to the participants at the following places: 

475 422 84 411 453 210 157 294 146 188 420 367 29 356 398 155 102 239 91 133 365 312 449 301 343



In the second example, you have to do two successful and one unsuccessful hack to make your score equal to 7408.

In the third example, you need to do as many as 24 successful hacks to make your score equal to 10400.

In the fourth example, it's sufficient to do 6 unsuccessful hacks (and no successful ones) to make your score equal to 6500, which is just enough for winning the current round and also getting the T-shirt.

Difficulty: EASY
Tags: Implementation

Complete search
Skill types: Complete search

Starter code:

Solutions:
(p, x, y) = map(int, input().split())
cur = x
while cur - 50 >= y:
	cur -= 50

def gen(s):
	i = s // 50 % 475
	res = []
	for _ in range(25):
		i = (i * 96 + 42) % 475
		res.append(26 + i)
	return res
while p not in gen(cur):
	cur += 50
print((max(cur - x, 0) + 99) // 100)


(p, x, y) = map(int, input().split())
k = (x - y) // 50
d = x // 50 - k
n = 1 - k
while 1:
	i = d % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if i == p - 26:
			print((n > 0) * n // 2)
			exit()
	n += 1
	d += 1


from sys import stdin
(a, b, c) = map(int, stdin.readline().split())

def score(s):
	i = s // 50 % 475
	for repeat in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == a:
			return True
	return False

def ok():
	for i in range(c, c + 20001):
		if score(i) and i % 50 == b % 50:
			if i <= b:
				return 0
			elif (b - i) % 100 == 0:
				return (i - b) // 100
			else:
				return (i - b + 50) // 100
print(abs(ok()))


from math import ceil
(p, x, y) = map(int, input().split())
h = x
while h >= y:
	h -= 50
h += 50
for i in range(h, 10000000000, 50):
	u = i // 50 % 475
	d = []
	for j in range(25):
		u = (u * 96 + 42) % 475
		d.append(26 + u)
	if p in d:
		k = i
		break
if k - x > 0:
	print(ceil((k - x) / 100))
else:
	print(0)


def check(x, p):
	i = x // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			return 1
	return 0
(p, x, y) = map(int, input().split())
if check(x, p):
	exit(print(0))
for i in range(x, y - 1, -50):
	if check(i, p):
		exit(print(0))
x += 100
a = 1
while 1:
	if check(x, p) or check(x - 50, p):
		exit(print(a))
	x += 100
	a += 1


import sys
inf = 1 << 60

def solve():
	(p, x, y) = map(int, input().split())
	for s in range(x, y - 1, -50):
		if p in list_tshirt(s):
			print(0)
			return
	for i in range(1, 476):
		s = x + i * 50
		if p in list_tshirt(s):
			print((i + 1) // 2)
			return

def list_tshirt(s):
	res = [0] * 25
	i = s // 50 % 475
	for k in range(25):
		i = (i * 96 + 42) % 475
		res[k] = i + 26
	return res
solve()


def check(g, s):
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == g:
			return True
	return False
(g, p, t) = map(int, input().split())
tot = 0
s = p
while s >= t:
	if s >= t and check(g, s):
		print(tot)
		exit()
	s -= 50
s = p
while True:
	if s >= t and check(g, s):
		break
	if s - 50 >= t and check(g, s - 50):
		break
	s += 100
	tot += 1
print(tot)


s = 4000
i = s // 50 % 475
allvals = []
while len(allvals) == 0 or (i * 96 + 42) % 475 != allvals[0]:
	i = (i * 96 + 42) % 475
	allvals.append(i)
(p, x, y) = [int(x) for x in input().split(' ')]
CurrState = x // 50 % 475
me = p - 26
whereMe = allvals.index(me)
acceptingStates = []
for i in range(25):
	acceptingStates.append(allvals[whereMe - i - 1])
negAcc = [x - 475 for x in acceptingStates]
acceptingStates.sort()
negAcc.sort()
sa = set(acceptingStates)
maxNeg = 0
if y % 50 <= x % 50:
	maxNeg = (x - y) // 50
else:
	maxNeg = (x - y) // 50
minVisitabeState = (CurrState - maxNeg + 475) % 475
minVisitabeStates = [minVisitabeState]
for i in range(10000):
	minVisitabeStates.append(minVisitabeStates[-1] + 1)
aornot = [None] * 10000
for i in range(10000):
	aornot[i] = int(minVisitabeStates[i] in sa)
mypos = minVisitabeStates.index(CurrState)
fl = 1
for i in range(mypos + 1):
	if aornot[i]:
		print(0)
		fl = 0
		break
if fl:
	facc = aornot.index(1)
	if facc % 2 != mypos % 2:
		facc += 1
	print((facc - mypos) // 2)


import sys
input_ = sys.stdin.readline

def precompute_places():
	res = {}
	for i in range(476):
		res[i] = get_tshirt_winners(i)
	return res

def get_tshirt_winners(i):
	winners = set()
	for _ in range(25):
		i = (i * 96 + 42) % 475
		winners.add(i + 26)
	return winners

def can_haz_tshirt(s, p, places):
	i = s // 50 % 475
	if p in places[i]:
		return True
	return False

def main():
	(p, x, y) = list(map(int, input_().split()))
	places = precompute_places()
	x_down = x
	while x_down >= y:
		if can_haz_tshirt(x_down, p, places):
			return 0
		x_down -= 50
	x += 100
	successes = 1
	for _ in range(476):
		if can_haz_tshirt(x, p, places) or can_haz_tshirt(x - 50, p, places):
			return successes
		x += 100
		successes += 1
	return -1

def __starting_point():
	print(main())
__starting_point()


import sys

def main():
	(p, x, y) = list(map(int, sys.stdin.readline().split()))
	s = x
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		next = 26 + i
		if next == p:
			result = 0
			sys.stdout.write(str(result) + '\n')
			return
	s = x - 50
	while True:
		if s < y:
			break
		i = s // 50 % 475
		for _ in range(25):
			i = (i * 96 + 42) % 475
			next = 26 + i
			if next == p:
				result = 0
				sys.stdout.write(str(result) + '\n')
				return
		s -= 50
	iplus = 1
	while True:
		for s in (x + iplus * 100, x + iplus * 100 - 50):
			i = s // 50 % 475
			for _ in range(25):
				i = (i * 96 + 42) % 475
				next = 26 + i
				if next == p:
					result = iplus
					sys.stdout.write(str(result) + '\n')
					return
		iplus += 1
main()


l = input().split()
(p, x, y) = (int(l[0]) - 26, int(l[1]), int(l[2]))

def ch(n):
	i = n // 50 % 475
	for c in range(25):
		i = (i * 96 + 42) % 475
		if i == p:
			return 0
	return 1
z = y + (x - y) % 50
while ch(z):
	z += 50
if z > x:
	n = (z - x) // 50
	print((n >> 1) + (n & 1))
else:
	print('0')


import math

def check(s, p):
	k = s // 50 % 475
	for i in range(25):
		k = (k * 96 + 42) % 475
		if 26 + k == p:
			return True
	return False

def solve():
	(p, x, y) = list((int(i) for i in input().split()))
	for i in range(0, 100000):
		if x - 50 * i >= y:
			if check(x - 50 * i, p):
				print(0)
				return
	for i in range(0, 100000):
		if x + 50 * i >= y:
			if check(x + 50 * i, p):
				print((i + 1) // 2)
				return

def main():
	solve()
	exit(0)
main()


def mp():
	return map(int, input().split())

def lt():
	return list(map(int, input().split()))

def pt(x):
	print(x)

def ip():
	return input()

def it():
	return int(input())

def sl(x):
	return [t for t in x]

def spl(x):
	return x.split()

def aj(liste, item):
	liste.append(item)

def bin(x):
	return '{0:b}'.format(x)

def listring(l):
	return ' '.join([str(x) for x in l])

def ptlist(l):
	print(' '.join([str(x) for x in l]))
(p, x, y) = mp()
z = x
i = z // 50 % 475
a = []
for _ in range(25):
	i = (i * 96 + 42) % 475
	a.append(26 + i)
while z - 50 >= y and (not p in a):
	z -= 50
	i = z // 50 % 475
	a = []
	for _ in range(25):
		i = (i * 96 + 42) % 475
		a.append(26 + i)
if p in a:
	print('0')
else:
	bl = True
	t = 1
	while bl:
		z = x + t * 100
		i = z // 50 % 475
		a = []
		for _ in range(25):
			i = (i * 96 + 42) % 475
			a.append(26 + i)
		if p in a:
			bl = False
		else:
			z -= 50
			i = z // 50 % 475
			a = []
			for _ in range(25):
				i = (i * 96 + 42) % 475
				a.append(26 + i)
			if p in a:
				bl = False
			else:
				t += 1
	pt(t)


import math
z = input()
z = z.split(' ')
p = int(z[0])
x = int(z[1])
y = int(z[2])
i = int(math.floor(x / 50))
i = i % 475
flag = 0
for j in range(0, 25):
	i = (i * 96 + 42) % 475
	if 26 + i == p:
		print('0')
		flag = 1
		break
if flag != 1:
	ans = 0
	while 1:
		curr = x + 100 * ans
		while curr >= y:
			i = int(math.floor(curr / 50))
			i = i % 475
			win = {}
			for j in range(0, 25):
				i = (i * 96 + 42) % 475
				if 26 + i == p:
					print(ans)
					flag = 1
					break
			curr -= 50
			if flag == 1:
				break
		ans += 1
		if flag == 1:
			break


import sys
lst = [int(i) for i in input().split()]

def check(number):
	lst = []
	i = int(number / 50) % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		lst.append(i + 26)
	return lst
if lst[0] in check(lst[1]) and lst[1] >= lst[2]:
	print(0)
	sys.exit()
n2 = lst[1] - 50
while n2 >= lst[2]:
	if lst[0] in check(n2):
		print(0)
		sys.exit()
	n2 = n2 - 50
else:
	n1 = lst[1]
	counter = 0
	while True:
		n1 = n1 + 50
		counter += 1
		if lst[0] in check(n1) and n1 >= lst[2]:
			if counter % 2 == 0:
				print(int(counter / 2))
				break
			else:
				print(int(counter / 2) + 1)
				break


INF = 99 ** 9
(p, x, y) = map(int, input().split())
kat_x = x // 50
kat_y = y // 50
kat_high = 999999990
if y > x:
	t = -1
	res = -1
	for i in range(kat_y, kat_high):
		if res > 0:
			break
		t += 1
		k = i % 475
		for _ in range(25):
			k = (k * 96 + 42) % 475
			if k + 26 == p:
				res = t
				break
	print((res - kat_x + 1) // 2)
else:
	t = -1
	res = INF
	if x % 50 < y % 50:
		kat_y += 1
	for i in range(kat_x, kat_y - 1, -1):
		if res != INF:
			break
		t += 1
		k = i % 475
		for _ in range(25):
			k = (k * 96 + 42) % 475
			if k + 26 == p:
				res = t
				print(0)
				break
	t = -1
	if res == INF:
		pp = True
		for i in range(kat_x, kat_high):
			if pp == False:
				break
			t += 1
			k = i % 475
			for _ in range(25):
				k = (k * 96 + 42) % 475
				if k + 26 == p:
					res = min(res, t)
					pp = False
					break
		print((res + 1) // 2)


def win(s):
	i = s // 50 % 475
	l = []
	for _ in range(25):
		i = (i * 96 + 42) % 475
		l.append(26 + i)
	return l
(p, x, y) = list(map(int, input().split()))
(c, x1) = (0, x)
while x - 50 >= y:
	x -= 50
while p not in win(x):
	x += 50
	if x > x1:
		c += 50
print(c // 100 if c % 100 == 0 else c // 100 + 1)


(p, x, y) = map(int, input().split())

def check(s):
	i = s // 50 % 475
	for t in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			return True
	return False
flag = False
for up in range(500):
	for down in range(500):
		if x + 100 * up - 50 * down >= y and check(x + 100 * up - 50 * down):
			print(up)
			flag = True
			break
	if flag:
		break


(p, x, y) = map(int, input().split())

def solve(s):
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			return True
	else:
		return False
for i in range(500):
	for j in range(500):
		if x + i * 100 - j * 50 >= y and solve(x + i * 100 - j * 50) == True:
			print(i)
			exit()


import itertools
(p, x, y) = map(int, input().split())
d = (x - y) // 50
p -= 26
i0 = x // 50 % 475
for k in itertools.count(-d):
	i = (i0 + k) % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		if i == p:
			print(max(0, (k + 1) // 2))
			exit()


from sys import stdin, stdout
from math import ceil
(p, x, y) = map(int, stdin.readline().split())
s = set()
if x < y:
	ans = (y - x) // 100
	x = x + 100 * ans
else:
	ans = 0
if x >= y:
	label = 0
	for i in range(100):
		xc = x + 100 * i
		while xc >= y:
			if not xc in s:
				s.add(xc)
				ind = xc // 50 % 475
				for j in range(25):
					ind = (ind * 96 + 42) % 475
					if ind + 26 == p:
						label = 1
						ans += i
				if label:
					break
			elif i:
				break
			xc -= 50
		if label:
			break
stdout.write(str(ans))


(p, x, y) = map(int, input().split())

def ok_numbers(s):
	i = s // 50 % 475
	ret = set([])
	for _ in range(25):
		i = (i * 96 + 42) % 475
		ret.add(i + 26)
	return ret
lo_x = x
while lo_x >= y:
	if p in ok_numbers(lo_x):
		print(0)
		exit()
	lo_x -= 50
cnt = 1
while True:
	if p in ok_numbers(x + 50) or p in ok_numbers(x + 100):
		print(cnt)
		exit()
	cnt += 1
	x += 100


def check(s, p):
	i = s // 50 % 475
	for t in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			return True
	return False
(p, x, y) = map(int, input().split())
ans = -1
for i in range((x - y) // 50 + 1):
	if check(x - 50 * i, p):
		ans = 0
		break
win = 0
while ans == -1:
	win += 1
	for fail in range(2):
		if check(x + 100 * win - 50 * fail, p):
			ans = win
			break
print(ans)


import math
(p, x, y) = map(int, input().split())
s = 0
s = int(math.ceil((y - x) / 50))
while s <= 1000000:
	score = x + 50 * s
	i = score // 50 % 475
	l = []
	for j in range(25):
		i = (i * 96 + 42) % 475
		l.append(26 + i)
	if p in l:
		break
	else:
		s += 1
if s <= 0:
	print(0)
else:
	print(int(math.ceil(s / 2)))


(p, x, y) = map(int, input().split())

def f(s):
	rtn = []
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		rtn.append(26 + i)
	return rtn
ans = -1
tmp = x
while y <= tmp:
	if p in f(tmp):
		ans = 0
		break
	tmp -= 50
tmp = x
while ans < 0:
	tmp += 50
	if p in f(tmp):
		ans = (tmp - x + 50) // 100
print(ans)


(p, x, y) = list(map(int, input().split()))
s = 0
while 1 > 0:
	for sc in range(x, y - 1, -50):
		i = sc // 50 % 475
		for _ in range(25):
			i = (i * 96 + 42) % 475
			if 26 + i == p:
				print(s)
				exit(0)
	s += 1
	x += 100


(p, x, y) = map(int, input().split())
ls = []
i = x // 50 % 475
for z in range(25):
	i = (i * 96 + 42) % 475
	ls.append(i + 26)
if p in ls:
	print(0)
	quit()
l = x - 50
m = x
while l >= y:
	ls = []
	i = l // 50 % 475
	for z in range(25):
		i = (i * 96 + 42) % 475
		ls.append(i + 26)
	if p in ls:
		print(0)
		quit()
	l -= 50
index = 1
while True:
	ls = []
	i = (m + index * 50) // 50 % 475
	for z in range(25):
		i = (i * 96 + 42) % 475
		ls.append(i + 26)
	if p in ls:
		print((50 * index + 50) // 100)
		break
	else:
		index += 1


(p, x, y) = map(int, input().split())
Tshirt = []
s = 0
hk = 0
suchk = 0
while x < y:
	hk += 1
	x += 100

def genT():
	s = x
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		Tshirt.append(26 + i)
genT()
if p in Tshirt:
	print(suchk)
	exit(0)
orgx = x
while x >= y:
	Tshirt = []
	genT()
	if p in Tshirt:
		print(suchk)
		exit(0)
	x -= 50
x = orgx
while not p in Tshirt:
	Tshirt = []
	hk += 1
	if hk % 2 == 1:
		suchk += 1
	x += 50
	genT()
print(suchk)


import math
(p, x, y) = map(int, input().split())
q = 0
s = x
T = False
counter = 1
while x - y >= 0:
	i = x // 50 % 475
	for k in range(25):
		i = (i * 96 + 42) % 475
		ans = i + 26
		if ans == p:
			print(q)
			T = True
			break
	if T:
		break
	x -= 50
else:
	while True:
		i = s // 50 % 475
		for k in range(25):
			i = (i * 96 + 42) % 475
			ans = i + 26
			if ans == p:
				print(q)
				T = True
				break
		if T:
			break
		s += 50
		counter += 1
		if counter % 2 == 0:
			q += 1


def editor():
	import sys
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	(p, x, y) = map(int, input().split())

	def score(sc):
		l = []
		i = sc // 50 % 475
		for _ in range(25):
			i = (i * 96 + 42) % 475
			l.append(26 + i)
		return l
	ans = 0
	wronged = 0
	cursc = x
	if x >= y:
		cur = x
		while cur >= y:
			l = score(cur)
			if p in l:
				print(0)
				return
			else:
				cur -= 50
		while True:
			l = score(cursc)
			if p in l:
				print(ans)
				return
			else:
				cursc += 50
				ans += wronged % 2 == 0
				wronged += 1
	else:
		ans += (y - x) // 100
		if (y - x) % 100 != 0:
			ans += 1
		cursc += ans * 100
		if cursc - y >= 50:
			cursc -= 50
			wronged = 1
		while True:
			l = score(cursc)
			if p in l:
				print(ans)
				break
			else:
				cursc += 50
				ans += wronged % 2 == 0
				wronged += 1
tc = 1
for t in range(tc):
	solve()


(p, x, y) = map(int, input().split())

def shirtpicking(s, test):
	i = s // 50 % 475
	res = []
	for t in range(25):
		i = (i * 96 + 42) % 475
		res.append(i + 26)
	if test in res:
		return True
	else:
		return False
if x >= y:
	for x1 in range((x - y) // 50 + 1):
		if shirtpicking(x - x1 * 50, p):
			print(0)
			exit()
ans = 0
s = x
ints = 0
while ans == 0:
	s += 50
	ints += 1
	if shirtpicking(s, p):
		print((ints + 1) // 2)
		exit()


(p, x, y) = map(int, input().split())
r = x
z = 0
m = 0
c = -1
a = [0] * 25
while r >= y:
	s = x - z * 50
	i = s // 50 % 475
	for q in range(25):
		i = (i * 96 + 42) % 475
		a[q] = 26 + i
	r -= 50
	z += 1
	for i in range(25):
		if a[i] == p:
			c = 0
			m = 1
if c != 0:
	c = 0
	while m != 1:
		c += 1
		s = x - 50 + c * 100
		i = s // 50 % 475
		for q in range(25):
			i = (i * 96 + 42) % 475
			a[q] = 26 + i
		for i in range(25):
			if a[i] == p:
				m = 1
		s = x + c * 100
		i = s // 50 % 475
		for q in range(25):
			i = (i * 96 + 42) % 475
			a[q] = 26 + i
		for i in range(25):
			if a[i] == p:
				m = 1
print(c)


import math

def check(score):
	k = score // 50 % 475
	for i in range(25):
		k = (k * 96 + 42) % 475
		if 26 + k == p:
			return True
	return False
(p, x, y) = map(int, input().split())
t = math.ceil((y - x) / 50)
if p <= 25:
	print(t)
else:
	while not check(x + 50 * t):
		t += 1
	print(max(0, (t + 1) // 2))


from sys import stdin, stdout

def findWinners(s):
	winSet = set()
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		winSet.add(26 + i)
	return winSet
(p, x, y) = map(int, stdin.readline().rstrip().split())
x1 = x
successfulHacks = 0
winning = False
while x1 >= y and (not winning):
	if p in findWinners(x1):
		winning = True
	x1 -= 50
while not winning:
	x += 100
	successfulHacks += 1
	if p in findWinners(x) or p in findWinners(x - 50):
		winning = True
print(successfulHacks)


def ok(s, r):
	res = s // 50 % 475
	for i in range(25):
		res = (res * 96 + 42) % 475
		if 26 + res == r:
			return True
	return False
(P, X, Y) = map(int, input().split())
if any((ok(i, P) for i in range(X, Y - 1, -50))):
	exit(print(0))
else:
	ans = 1
	X += 100
	while True:
		if ok(X, P) or ok(X - 50, P):
			exit(print(ans))
		X += 100
		ans += 1


def check(s, p):
	i = s // 50 % 475
	checking = False
	for j in range(25):
		i = (i * 96 + 42) % 475
		if p == i + 26:
			checking = True
	return checking
(p, x, y) = list(map(int, input().split()))
raznica = (x - y) // 50
xx = x
flag = True
if check(xx, p):
	flag = False
xx -= 50
for i in range(raznica):
	if check(xx, p):
		flag = False
	xx -= 50
result = 0
while flag:
	if check(x, p):
		flag = False
		break
	if check(x - 50, p) and x - 50 > y:
		flag = False
		break
	x += 100
	result += 1
print(result)


(p, x, y) = map(int, input().split())
mn = [10 ** 10]

def tr(a):
	i = a // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		l = 26 + i
		if l == p:
			if a <= x:
				mn[0] = min(mn[0], 0)
			else:
				k = (a - x) // 50
				if k % 2 == 0:
					mn[0] = min(mn[0], k // 2)
				else:
					mn[0] = min(mn[0], (k + 1) // 2)
st = 0
for i in range(50):
	if x % 50 == (y + i) % 50:
		st = y + i
		break
for i in range(st, 5 * 100000, 50):
	tr(i)
print(*mn)


import math
(p, x, y) = map(int, input().split())
origx = x
while (y - x) % 50 != 0:
	y += 1
while True:
	global target
	winners = set()
	i = y // 50 % 475
	for z in range(25):
		i = (i * 96 + 42) % 475
		winners.add(26 + i)
	if p in winners:
		target = y
		break
	y += 50
if target < origx:
	print(0)
else:
	print(math.ceil((target - x) / 100))


import math
import re
import random

def generator(s):
	a = []
	i = s // 50 % 475
	for k in range(25):
		i = (i * 96 + 42) % 475
		a.append(26 + i)
	return a
(p, x, y) = list(map(int, input().split()))
ans = 10000000000000
for a in range(2000):
	for b in range(2000):
		k = x + 100 * a - 50 * b
		if k >= y and p in generator(k):
			ans = min(ans, a)
			print(ans)
			return
print(ans)


def winner(x, y):
	for i in y:
		if x == i:
			return True
	return False

def IsWinner(p, s):
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if p == i + 26:
			return True
	return False
line = input()
p = int(line.split()[0])
x = int(line.split()[1])
y = int(line.split()[2])
a_up = 0
a = -1
found = False
cs = x
while cs >= y:
	if IsWinner(p, cs):
		a = 0
		break
	if IsWinner(p, cs + 50):
		a = 1
	cs = cs - 50
cs = x
if a == -1:
	while True:
		a_up = a_up + 1
		cs = cs + 100
		if IsWinner(p, cs) or IsWinner(p, cs - 50):
			a = a_up
			break
print(a)


import math
(p, x, y) = [int(i) for i in input().split()]
origin = x
while x < y:
	x += 50
found = False
copy1 = x - 50
while copy1 >= y:
	i = copy1 // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			found = True
			break
	if found:
		break
	copy1 -= 50
while not found:
	i = x // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			found = True
			break
	if found:
		break
	x += 50
hack = math.ceil((x - origin) / 100.0)
print(hack)


import sys

def eligible(score, position, thresh):
	if score < thresh:
		return False
	i = score // 50 % 475
	for __ in range(25):
		i = (i * 96 + 42) % 475
		if position == 26 + i:
			return True
	return False

def main():
	(p, x, y) = list(map(int, sys.stdin.readline().split()))
	diff = 0
	for __ in range(475):
		if eligible(x + diff, p, y):
			print('0')
			return
		diff -= 50
	diff = 0
	for __ in range(475):
		if eligible(x + diff, p, y):
			succ = diff // 100
			unsucc = diff // 50 % 2
			print(str(succ + unsucc))
			return
		diff += 50
main()


def Ts(rank, score):
	arr = []
	i = score // 50 % 475
	for x in range(25):
		i = (i * 96 + 42) % 475
		arr.append(26 + i)
	if rank in arr:
		return False
	else:
		return True
(rank, cur, need) = map(int, input().split())
t_cur = cur
while cur - 50 >= need:
	cur -= 50
while Ts(rank, cur):
	cur += 50
cur -= t_cur
cur += 50
if cur < 0:
	ans = 0
else:
	ans = cur // 100
print(ans)


(p, x, y) = map(int, input().split())
s = x - 50 * ((x - y) // 50)
while True:
	P = set()
	a = s // 50 % 475
	for _ in range(25):
		a = (a * 96 + 42) % 475
		P.add(a + 26)
	if p in P:
		if s <= x:
			print(0)
		else:
			ret = (s + 50 - x) // 100
			print(ret)
		break
	s += 50


def places(s):
	places = []
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		places.append(26 + i)
	return places
a = list(map(int, input().split()))
place = a[0]
current = a[1]
minimum = a[2]
pl = places(current)
if place in pl:
	print(0)
	exit(0)
while current > minimum:
	current -= 50
	if current >= minimum:
		pl = places(current)
		if place in pl:
			print(0)
			exit(0)
current1 = a[1]
current2 = a[1] - 50
attempts1 = 0
attempts2 = 0
while True:
	current1 += 100
	attempts1 += 1
	pl = places(current1)
	if place in pl:
		print(attempts1)
		exit(0)
	current2 += 100
	attempts2 += 1
	pl = places(current2)
	if place in pl:
		print(attempts2)
		exit(0)


from sys import stdin
input = stdin.readline
(p, x, y) = [int(i) for i in input().split()]

def shirt(score, place):
	i = int(score / 50) % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if place == i + 26:
			return True
	return False
ans = -1
c = x
while c >= y:
	if shirt(c, p):
		ans = 0
		break
	else:
		c -= 50
if ans == -1:
	c = 0
	while True:
		if shirt(c * 100 + 50 + x, p) or shirt(c * 100 + 100 + x, p):
			ans = c + 1
			break
		else:
			c += 1
print(ans)


def f(s):
	i = s // 50 % 475
	l = []
	for j in range(25):
		i = (i * 96 + 42) % 475
		l.append(26 + i)
	return l
(p, x, y) = map(int, input().split())
i = x
while i >= y:
	i -= 50
	if f(i).count(p) > 0:
		break
if i >= y:
	print(0)
	exit(0)
i = x
c = 0
while True:
	if f(i).count(p) > 0:
		break
	i += 50
	c += 1
if c % 2 == 1:
	print((c + 1) // 2)
else:
	print(c // 2)


import math

def get_tshirts(S):
	winners = []
	i = S // 50 % 475
	for x in range(25):
		i = (i * 96 + 42) % 475
		winners.append(26 + i)
	return winners

class CodeforcesTask807BSolution:

	def __init__(self):
		self.result = ''
		self.p_x_y = []

	def read_input(self):
		self.p_x_y = [int(x) for x in input().split(' ')]

	def process_task(self):
		hacks = 0.0
		if self.p_x_y[1] < self.p_x_y[2]:
			hacks += (self.p_x_y[2] - self.p_x_y[1]) // 100 + math.ceil((self.p_x_y[2] - self.p_x_y[1]) % 100 / 100)
			self.p_x_y[1] += (self.p_x_y[2] - self.p_x_y[1]) // 100 * 100 + math.ceil((self.p_x_y[2] - self.p_x_y[1]) % 100 / 100) * 100
		started = self.p_x_y[1]
		if self.p_x_y[1] > self.p_x_y[2]:
			self.p_x_y[1] = self.p_x_y[1] - (self.p_x_y[1] - self.p_x_y[2]) // 50 * 50
		while self.p_x_y[0] not in get_tshirts(self.p_x_y[1]):
			if self.p_x_y[1] >= started:
				hacks += 0.5
			self.p_x_y[1] += 50
		hacks += 0.5
		self.result = str(int(hacks * 2 // 2))

	def get_result(self):
		return self.result
Solution = CodeforcesTask807BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


import math
import sys
import bisect
from heapq import heapify, heappop, heappush
from itertools import *
from collections import deque, OrderedDict
sys.setrecursionlimit(10 ** 6)
II = lambda : sys.stdin.readline()
inp = lambda : int(II())
inpm = lambda : map(int, II().split())
inpl = lambda : list(inpm())
arr_mn = lambda _n, _m: [[0 for __ in range(_m)] for _ in range(_n)]
arr_nn = lambda _n: arr_mn(_n, _n)
EPS = 1e-09
INF = int(1e+18)
MOD = int(1000000000.0) + 7
N = 2000009
mod = 475

def check(p, s):
	i = s // 50 % mod
	for _ in range(25):
		i = (i * 96 + 42) % mod
		if i + 26 == p:
			return True
	return False

def solve():
	(p, x, y) = inpm()
	s = x
	for q in range(x, y - 1, -50):
		if check(p, q):
			print(0)
			return
	for i in range(mod):
		if check(p, s + i * 50):
			print((i + 1) // 2)
			return

def main():
	t = 1
	for i in range(t):
		solve()
main()


(p, x, y) = map(int, input().split())

def luck(s, p):
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			return True
	return False
down = x
while down >= y:
	if luck(down, p):
		print(0)
		exit(0)
	down -= 50
cur = x
if y > x:
	cur = x + 50 * ((y - x + 1) // 50)
while not luck(cur, p):
	cur += 50
hacks = (cur - x + 99) // 100
print(hacks)


def winners_list(s):
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		yield (26 + i)

def count_hacks():
	(p, x, y) = input().split(' ')
	p = int(p)
	x = int(x)
	y = int(y)
	current_winners = list(winners_list(x))
	if x >= y and p in current_winners:
		return 0
	mix = x
	for _ in range(x // 50):
		mix -= 50
		current_winners_minus_50 = list(winners_list(mix))
		if mix >= y and p in current_winners_minus_50:
			return 0
	succesful_hacks = 0
	won = False
	while not won:
		succesful_hacks += 1
		x += 100
		current_winners = list(winners_list(x))
		if x >= y and p in current_winners:
			return succesful_hacks
		current_winners_minus_50 = list(winners_list(x - 50))
		if x - 50 >= y and p in current_winners_minus_50:
			return succesful_hacks
print(count_hacks())


from sys import stdin, stdout
(p, x, y) = map(int, stdin.readline().strip().split())

def getScores(s):
	scores = []
	i = s // 50 % 475
	for g in range(25):
		i = (i * 96 + 42) % 475
		scores.append(26 + i)
	return scores
z = x
count = 0
while True:
	if x > y:
		if p in getScores(x):
			break
		else:
			x += 50
			count += 1
	else:
		x += 50
		count += 1
dcount = 0
dF = False
x = z
while x >= y:
	if p in getScores(x):
		dF = True
		break
	else:
		x -= 50
		dcount += 1
if dF == True or count == 0:
	print(0)
else:
	print(count // 2 + count % 2)


def main():
	(p, x, y) = list(map(int, input().split()))
	xcopy = x
	while xcopy >= y:
		if p in choice(xcopy):
			print(0)
			return
		xcopy -= 50
	i = 1
	while x <= 23800:
		if p in choice(x + 100 * i - 50) or p in choice(x + 100 * i):
			print(i)
			return
		i += 1

def choice(s):
	i = s // 50 % 475
	res = []
	for n in range(25):
		i = (i * 96 + 42) % 475
		res.append(26 + i)
	return res

def __starting_point():
	main()
__starting_point()


(p, x, y) = map(int, input().split())

def can(x):
	x = x // 50 % 475
	for i in range(25):
		x = (x * 96 + 42) % 475
		if x + 26 == p:
			return True
	return False
for i in range(1000):
	for j in range(1000):
		if x + 100 * i - 50 * j >= y and can(x + 100 * i - 50 * j):
			print(i)
			exit()


def isTshirt(s):
	i = int(s / 50) % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		if p == 26 + i:
			return True
	return False

def calcAns(p, x, y):
	s = x
	while s >= y:
		if isTshirt(s):
			return 0
		s = s - 50
	i = 1
	s = x
	while True:
		s = s + 50
		i = i + 1
		if s >= y and isTshirt(s):
			return int(i / 2)
(p, x, y) = map(int, input().split())
print(calcAns(p, x, y))


def calc_T_shirt_winner_places(s):
	i = s // 50 % 475
	i_indices = set()
	for j in range(25):
		i = (i * 96 + 42) % 475
		i_indices.add(26 + i)
	return i_indices

def reachable_by_unsuccessful_hacks(wanted_place, orig_score, min_place):
	score = orig_score
	while score >= min_place:
		if wanted_place in calc_T_shirt_winner_places(score):
			return True
		score -= 50
	if wanted_place in calc_T_shirt_winner_places(score) and score >= min_place:
		return True
	return False

def calc_number_of_successful_hacks_needed(wanted_place, orig_score):
	hacks = 0
	(score_by_50, score_by_100) = (orig_score + 50, orig_score + 100)
	while True:
		hacks += 1
		if score_by_50 >= min_place and wanted_place in calc_T_shirt_winner_places(score_by_50) or (score_by_100 >= min_place and wanted_place in calc_T_shirt_winner_places(score_by_100)):
			return hacks
		score_by_50 += 100
		score_by_100 += 100
(codecraft_place, curr_score, min_place) = [int(p) for p in input().split()]
if reachable_by_unsuccessful_hacks(codecraft_place, curr_score, min_place):
	print(0)
else:
	print(calc_number_of_successful_hacks_needed(codecraft_place, curr_score))


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
d = defaultdict(int)

def s(x):
	l = []
	for i in range(25):
		x = x * 96
		x += 42
		x %= 475
		l.append(26 + x)
	return l
l = []
for i in range(475):
	l.append(s(i))
(p, x, y) = M()
t = (x - y) // 50
start = x - t * 50
while True:
	key = start // 50 % 475
	for i in l[key]:
		if p == i:
			print(max(0, mt.ceil((start - x) / 100)))
			exit()
	else:
		start += 50


from sys import stdin
(a, b, c) = map(int, stdin.readline().split())

def score(s):
	i = s // 50 % 475
	for repeat in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == a:
			return True
	return False

def ok():
	for i in range(476):
		for j in range(476):
			if b + 100 * i - 50 * j >= c and score(b + 100 * i - 50 * j):
				return i
print(ok())


def f(n):
	i = n // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == p:
			return True
	return False
(p, x, y) = map(int, input().split())
k = 0
can = False
i = x
while i - 50 >= y:
	i -= 50
	if f(i):
		print(0)
		can = True
		break
if not can:
	for i in range(x, x + 30001, 50):
		if f(i):
			print(k)
			break
		if not (i - x) % 100:
			k += 1


def mat(s, p):
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == p:
			return True
	return False
(p, x, y) = map(int, input().split())
s = x
while s >= y:
	s -= 50
if s < y:
	s += 50
while not mat(s, p):
	s += 50
if s <= x:
	print(0)
else:
	print(int((s - x) / 100 + 0.5))


def checkWin(s, p):
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			return True
	return False
(p, x, y) = [int(i) for i in input().split()]
ans = 0
if x <= y:
	x1 = x
else:
	x1 = x - (x - y) // 50 * 50
while not checkWin(x1, p) or x < y:
	x1 += 50
	if x1 > x:
		ans += 1
print((ans + ans % 2) // 2)


import sys
read = lambda : sys.stdin.readline().rstrip()
readi = lambda : int(sys.stdin.readline())
writeln = lambda x: sys.stdout.write(str(x) + '\n')
write = lambda x: sys.stdout.write(x)

def tshirt(s):
	places = []
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		places.append(i + 26)
	return places

def solve(p, x, y):
	unit = 50
	places = tshirt(x)
	if p in places:
		return 0
	mid = x
	mag = 1
	found = False
	while mid - unit * mag >= y:
		places = tshirt(mid - unit * mag)
		if p in places:
			found = True
			break
		mag += 1
	if found:
		return 0
	mid = x
	mag = 1
	while True:
		places = tshirt(mid + unit * mag)
		if p in places:
			found = True
			break
		mag += 1
	answer = mid + unit * mag - x
	(q, r) = divmod(answer, 100)
	if r:
		return q + 1
	else:
		return q
(p, x, y) = map(int, read().split())
writeln(solve(p, x, y))


import sys
MOD = 1000000007

def inp():
	return sys.stdin.readline().strip()

def ii():
	return int(inp())

def iis():
	return [int(i) for i in inp().split()]
(p, x, y) = iis()

def checker(s):
	i = s // 50 % 475
	for _ in range(25):
		i = (i * 96 + 42) % 475
		if 26 + i == p:
			return True
	return False

def solve():
	cnt = 0
	for successful in range(200):
		for unsuccessful in range(400):
			new_x = x + 100 * successful - 50 * unsuccessful
			if new_x >= y and checker(new_x):
				return cnt
		cnt += 1
print(solve())


def findNumbers(s):
	t = [0] * 25
	i = s // 50 % 475
	for k in range(25):
		i = (i * 96 + 42) % 475
		t[k] = i + 26
	return t
(p, x, y) = map(int, input().split())
k = 0
if x >= y:
	xt = x
	while p not in findNumbers(xt) and xt >= y:
		xt -= 50
	if p in findNumbers(xt) and xt >= y:
		print(0)
	else:
		xt = x
		while p not in findNumbers(xt):
			xt += 50
			k += 0.5
		print(int(k + 0.5))
else:
	k = (y - x) // 100
	xt = (y - x) // 100 * 100 + x
	if xt < y:
		xt += 100
		k += 1
	while p not in findNumbers(xt) and xt >= y:
		xt -= 50
	if p in findNumbers(xt) and xt >= y:
		print(k)
	else:
		xt = x
		while p not in findNumbers(xt):
			xt += 50
			k += 0.5
		print(int(k + 0.5))


inp = input()
(p, x, y) = list(map(int, inp.split()))
Tshirt = []
s = x
while s >= y:
	Tshirt = []
	ans = s // 50 % 475
	for i in range(25):
		ans = (ans * 96 + 42) % 475
		Tshirt.append(ans + 26)
	if p in Tshirt:
		print(0)
		exit(0)
	s -= 50
hack = 0
while not p in Tshirt:
	Tshirt = []
	ans = x // 50 % 475
	for i in range(25):
		ans = (ans * 96 + 42) % 475
		Tshirt.append(ans + 26)
	x += 50
	hack += 1
print(hack // 2)


def test(s, p):
	i = s // 50 % 475
	for _ in range(25):
		i *= 96
		i += 42
		i %= 475
		if i + 26 == p:
			return True
	return False

def main():
	(p, x, y) = map(int, input().split())
	s = x - (x - y) // 50 * 50
	for _ in range(475):
		if test(s, p):
			break
		s += 50
	if s <= x:
		print(0)
	else:
		d = (s - x) // 50
		print((d + 1) // 2)
main()


import math
[p, x, y] = list(map(int, input().split()))
k = math.ceil((y - x) / 50)
while True:
	s = x + k * 50
	seq = list()
	z = s // 50 % 475
	for i in range(25):
		z = (z * 96 + 42) % 475
		seq.append(26 + z)
	if p in seq:
		print(max(0, (k + 1) // 2))
		exit(0)
	else:
		k += 1


import math
(p, x, y) = map(int, input().split())
s = y
while 1:
	if abs(x - s) % 50 == 0:
		break
	s -= -1
while 1:
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == p:
			break
	if i + 26 == p:
		break
	s += 50
if s <= x:
	print(0)
elif (s - x) % 100 == 0:
	print((s - x) // 100)
else:
	print((s - x) // 100 + 1)


L = [set() for _ in range(475)]
for i in range(475):
	x = i
	for j in range(25):
		x = (x * 96 + 42) % 475
		L[i].add(26 + x)
(p, x, y) = map(int, input().split())
s = x
l = y
ans = 10 ** 9
while s >= l:
	if p in L[s // 50 % 475]:
		ans = 0
		break
	s -= 50
off = 0
while x < y:
	x += 100
	off += 1
s = x // 50
t = set()
i = 0
while len(t) != 475:
	if p in L[s % 475] or (i > 0 and p in L[(s - 1) % 475]):
		ans = min(ans, off + i)
		break
	t.add(s % 475)
	t.add((s - 1) % 475)
	i += 1
	s += 2
print(ans)


def ps2(low, high):
	global flag
	if flag:
		t = -1
		for i in range(low, high + 1):
			t += 1
			i = i % 475
			for _ in range(25):
				i = (i * 96 + 42) % 475
				r = i + 26
				if r == p:
					result.append(t)
					flag = False
					break
			if flag == False:
				break

def ps1(low, high):
	global flag
	if flag:
		t = -1
		for i in range(high, low - 1, -1):
			t += 1
			jjj = i
			i = i % 475
			for _ in range(25):
				i = (i * 96 + 42) % 475
				r = i + 26
				if r == p:
					result.append(t)
					flag = False
					break
			if flag == False:
				break
(p, x, y) = map(int, input().split())
result = []
if x < y:
	mid = y
	if y % 50 != 0:
		mid += 1
	mid //= 50
	high = 99999999990
	flag = True
	ps2(mid, high)
	tt = mid - x // 50
	for i in range(len(result)):
		p = result[i]
		if p % 2 == 0:
			result[i] = int(p / 2)
		else:
			result[i] = int((p + 1) / 2)
	print(min(result) + tt)
else:
	low = y
	mid = x
	low //= 50
	mid //= 50
	if (x - y) % 50 != 0:
		low += 1
	high = 99999999990
	flag = True
	ps1(low, mid)
	if len(result) > 0:
		print(0)
	else:
		flag = True
		ps2(mid, high)
		for i in range(len(result)):
			p = result[i]
			if p % 2 == 0:
				result[i] = int(p / 2)
			else:
				result[i] = int((p + 1) / 2)
		print(min(result))


(p, x, y) = map(int, input().strip().split())

def t_shirt(s):
	i = int(s / 50)
	i %= 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == p:
			return 1
	return 0
cnt = 0
t = int(x)
flag = 0
while x >= y:
	if t_shirt(x):
		print(cnt)
		flag = 1
		break
	x -= 50
x = t
if flag == 0:
	while 1:
		cnt += 1
		x += 100
		if x < y:
			continue
		if t_shirt(x):
			print(cnt)
			break
		if t_shirt(x - 50):
			print(cnt)
			break


import sys
__author__ = 'buyvich'
SUCCESS_HACK = 100
UNSUCCESS_HACK = 50
MAX_SCORES = 20000

def get_win_places(scores):
	res = []
	k = scores // 50 % 475
	for _ in range(25):
		k = (k * 96 + 42) % 475
		res.append(26 + k)
	return res

def find_success_hack_count(place, current_scores, min_goal):
	goal = min_goal
	while True:
		if not (current_scores - goal) % 50:
			if place in get_win_places(goal):
				break
		goal += 1
	return (max(0, goal - current_scores) + 50) // 100
(place, current_scores, goal) = sys.stdin.readline().strip().split(' ')
success_hacks_count = find_success_hack_count(int(place), int(current_scores), int(goal))
sys.stdout.write('%s' % success_hacks_count)


def f(p, d, x, y):
	x += d * 50
	if x < y:
		return
	s = x // 50 % 475
	for i in range(25):
		s = (96 * s + 42) % 475
		if s + 26 == p:
			print(0 if d < 0 else d + 1 >> 1)
			exit()
(p, x, y) = map(int, input().split())
for i in range(-500, 500):
	f(p, i, x, y)


def checker(s, p):
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == p:
			return True
	return False
arr = list(map(int, input().split()))
p = arr[0]
x = arr[1]
y = arr[2]
mi = x
tr = False
while mi >= y:
	if checker(mi, p):
		tr = True
		print(0)
		break
	else:
		mi -= 50
if not tr:
	curr = x
	c = 1
	while True:
		if checker(curr + 50, p):
			print(c)
			break
		elif checker(curr + 100, p):
			print(c)
			break
		else:
			curr += 100
			c += 1


def psu(s, n):
	i = s // 50 % 475
	for erwt5 in range(25):
		i = (i * 96 + 42) % 475
		if i + 26 == n:
			return True
	return False
(pos, x, y) = map(int, input().split())
t = True
for i in range(x, y - 1, -50):
	if psu(i, pos):
		print(0)
		t = False
		break
if t:
	x += 100
	sh = 1
	while True:
		if psu(x, pos) or psu(x - 50, pos):
			break
		x += 100
		sh += 1
	print(sh)


(p, x, y) = map(int, input().split())

def f(s):
	i = s // 50 % 475
	for j in range(25):
		i = (i * 96 + 42) % 475
		if p == 26 + i:
			return True
	return False
for i in range(x - (x - y) // 50 * 50, 10 ** 9, 50):
	if f(i):
		print(max(0, (i - x + 50) // 100))
		break


import math
import sys

def my_fun(t, p):
	i = t // 50 % 475
	for j in range(0, 25):
		i = (i * 96 + 42) % 475
		if i + 26 == p:
			return 1
	return 0
(p, x, y) = map(int, input().split())
cur = x
f1 = 1
while cur >= y:
	if my_fun(cur, p):
		f1 = 0
		print(0)
		break
	cur -= 50
if f1:
	ans = 1
	tmp = x + 50
	while 1:
		if my_fun(tmp, p):
			print(int(ans))
			break
		tmp += 50
		ans += 0.5