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: interview

Starter code:

Solutions:
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)

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 = list(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)


'''input
329 19913 19900
'''
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)







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 calc_T_shirt_winner_places(s):
    """
    i := (s div 50) mod 475
repeat 25 times:
    i := (i * 96 + 42) mod 475
    print (26 + i)
    """
    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
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)))

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 = list(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(str(k) + " " + str(xt) )
        
        print( int(k+0.5))
else:
    k = (y-x) // 100
    xt = ((y-x) // 100) * 100 + x
    if xt<y:
        xt+=100
        k+=1
##    print(xt)
    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(str(k) + " " + str(xt) )
        
        print( int(k+0.5))
    


p, x, y = list(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)


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))

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 = list(map(int, input().split()))

i = x
while i >= y:
    i -= 50
    if f(i).count(p) > 0:
        break
if i >= y:
    print(0)
    return

i = x
c = 0
while True:
    if f(i).count(p) > 0:
        break
    i += 50
    c += 1

#print(i)

if c % 2 == 1:
    print((c + 1) // 2)
else:
    print(c // 2)

#print(f(7258 + 150))


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()

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

    # 0 check
    xcopy = x
    while xcopy >= y:
        if p in choice(xcopy):
            print(0)
            return
        xcopy -= 50

    # + check
    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():
    # nonlocal stime
    # stime = time.clock()
    main()


__starting_point()

p, x, y = list(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)


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()



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

def __starting_point():
    solve()
__starting_point()

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 func(arr, qb, allb, res):
#     for el in arr:
#         if el == 'b':
#             qb += 1
#         else:
#             allb += qb
#             qb = 0
#             res += allb
#             allb *= 2
#     return res
#
#
# arr = input()
#
#
# arr = arr[::-1]
#
# res = func(arr, 0, 0, 0)
#
# #print(res)
#
# print(res % (pow(10, 9) + 7))






# n = int(input())
#
#
# if n % 2 == 0:
#     print(n//2 - 1)
# else:
#     print(n//2)









#n = int(input())
# res = ''
# for i in range(n):
#     if i % 4 == 0 or i % 4 == 1:
#         res += 'a'
#     else:
#         res += 'b'
#
# print(res)






# l, r = map(int, input().split())
# if l == r and l % 2 != 0:
#     print(l)
# else:
#     print(2)











# n = int(input())
# a = list(map(len, input().replace('-', ' ').split()))
# for i in range(len(a) - 1):
#     a[i] += 1
#
#
#
#
#
# print(' '.join(map(str, a)))







# n = int(input())
# a = list(map(int, input().split()))
#
# b = []
# q = 0
# for i in range(n):
#     if a[i] != 0 and i != n-1:
#         q += 1
#     elif a[i] == 0 and i != n-1:
#        b.append(q)
#        q = 0
#     elif a[i] == 0 and i == n-1:
#         b.append(q)
#         b.append(0)
#         break
#     else:
#         q += 1
#         b.append(q)
#         break
#
#
# c = []
#
# for j in range(len(b)):
#     if j == 0:
#         for i in range(b[0]):
#             c.append(b[0] - i)
#         c.append(0)
#     elif j == len(b) - 1:
#         for i in range(b[j]):
#             c.append(i + 1)
#     else:
#
#         if b[j] % 2 == 0:
#             for i in range(b[j]//2):
#                 c.append(i + 1)
#             for i in range(b[j]//2):
#                 c.append(b[j]//2 - i)
#             c.append(0)
#         else:
#             for i in range(b[j]//2 + 1):
#                 c.append(i + 1)
#             for i in range(b[j]//2):
#                 c.append(b[j]//2 - i)
#             c.append(0)
#
#
# #print(' '.join(map(str, b)))
#
# print(' '.join(map(str, c)))


#print('2 1 0 1 0 0 1 2 3 ')










# n, k  = map(int, input().split())
#
#
# if k > n*n:
#     print (-1)
#     return
#
# a = [[0] * n for i in range(n)]
#
# for i in range(n):
#     if k == 0:
#         break
#     a[i][i] = 1
#     k -= 1
#     if k == 0:
#         break
#     elif k == 1:
#         a[i+1][i+1] = 1
#         break
#     else:
#         for j in range(i+1, min(n, i + 1 + k//2)):
#                        a[i][j] = 1
#                        a[j][i] = 1
#                        k -= 2
#
#
# for i in range(n):
#     print(' '.join(map(str, a[i])))


# n = int(input())
# a = list(map(int, input().split()))
# #print(' '.join(map(str, a)))
#
#
#
# b = set()
#
# for el in a:
#     if el-1 in b:
#         b.discard(el-1)
#         b.add(el)
#     else:
#         b.add(el)
#
# print(len(b))


# written by sak
#
#	sk<3
#
# powered by codechef

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
	#print(26+i)
	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


p,x,y = list(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 = list(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)


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)
        return
    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)


p,x,y=list(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)
    


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))

#!/usr/bin/env python
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 ## if 1, we need additional success
            print(str(succ + unsucc))
            return
        diff += 50

main()


from sys import stdin, stdout


p, x, y = list(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)