Limak is going to participate in a contest on the last day of the 2016. The contest will start at 20:00 and will last four hours, exactly until midnight. There will be n problems, sorted by difficulty, i.e. problem 1 is the easiest and problem n is the hardest. Limak knows it will take him 5·i minutes to solve the i-th problem.

Limak's friends organize a New Year's Eve party and Limak wants to be there at midnight or earlier. He needs k minutes to get there from his house, where he will participate in the contest first.

How many problems can Limak solve if he wants to make it to the party?


-----Input-----

The only line of the input contains two integers n and k (1 ≤ n ≤ 10, 1 ≤ k ≤ 240) — the number of the problems in the contest and the number of minutes Limak needs to get to the party from his house.


-----Output-----

Print one integer, denoting the maximum possible number of problems Limak can solve so that he could get to the party at midnight or earlier.


-----Examples-----
Input
3 222

Output
2

Input
4 190

Output
4

Input
7 1

Output
7



-----Note-----

In the first sample, there are 3 problems and Limak needs 222 minutes to get to the party. The three problems require 5, 10 and 15 minutes respectively. Limak can spend 5 + 10 = 15 minutes to solve first two problems. Then, at 20:15 he can leave his house to get to the party at 23:57 (after 222 minutes). In this scenario Limak would solve 2 problems. He doesn't have enough time to solve 3 problems so the answer is 2.

In the second sample, Limak can solve all 4 problems in 5 + 10 + 15 + 20 = 50 minutes. At 20:50 he will leave the house and go to the party. He will get there exactly at midnight.

In the third sample, Limak needs only 1 minute to get to the party. He has enough time to solve all 7 problems.

Difficulty: EASY
Tags: Mathematics

Sorting

Implementation

Complete search
Skill types: Sorting

Complete search

Starter code:

Solutions:
(n, k) = map(int, input().split())
t = k
i = 1
while t <= 240:
	t += 5 * i
	i += 1
print(min(n, i - 2))


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
(nb_problems, travel_time) = read_ints()
time_available = 240 - travel_time
solved = 0
while time_available >= 0 and solved <= nb_problems:
	solved += 1
	time_available -= 5 * solved
print(solved - 1)


(n, k) = map(int, input().split())
i = 0
while i * 5 + k <= 240 and i <= n:
	k += i * 5
	i += 1
print(i - 1)


(a, b) = input().split()
(a, b) = (int(a), int(b))
diff = 240 - b
if diff < 5:
	print(0)
else:
	while a > 0:
		x = 0
		for i in range(a, 0, -1):
			x += i * 5
		if diff >= x:
			print(a)
			break
		else:
			pass
		a -= 1


El_n = 0
El_k = 0
entrada = input().split(' ')
El_n = int(entrada[0])
El_k = int(entrada[1])
acumulado = 0
arreglo = []
for index in range(El_n):
	acumulado += (index + 1) * 5
	arreglo.append(acumulado)
max = El_n
min = 0
while max - min > 1:
	medio = int((max + min) / 2)
	if medio == min:
		break
	if arreglo[medio - 1] <= 240 - El_k:
		min = medio
	else:
		max = medio
if arreglo[min] <= 240 - El_k:
	print(min + 1)
else:
	print(min)


(n, k) = map(int, input().split())
i = 0
t = 0
tav = 240 - k
while 1:
	t += (i + 1) * 5
	if t > tav or i == n:
		break
	i += 1
print(i)


(a, b) = map(int, input().split())
c = 240 - b
d = 5
e = 0
while c >= d:
	c -= d
	d += 5
	e += 1
print(min(e, a))


(x, y) = input().split()
x = int(x)
y = int(y)
y = 240 - y
sum = 5
count = 1
while sum <= y and count <= x:
	count += 1
	sum += 5 * count
print(count - 1)


import math

def Elephant():
	(x, y) = [int(x) for x in input().split()]
	z = 0
	val = 0
	remainingTime = 240 - y
	while remainingTime >= val and z <= x:
		z = z + 1
		val += z * 5
	return z - 1
print(Elephant())


(n, k) = map(int, input().split())
t = 240 - k
(i, m) = (0, 1)
while t >= 0 and i <= n:
	t = t - 5 * m
	m += 1
	if t >= 0:
		i += 1
print(min(i, n))


from bisect import *
from itertools import *
(n, k) = map(int, input().split())
print(bisect_right(list(accumulate([i * 5 for i in range(1, n + 1)])), 240 - k))


(a, b) = map(int, input().split())
c = 240
i = 1
while b <= c:
	e = i * 5
	b = b + e
	i += 1
if a <= i - 2:
	print(a)
else:
	print(i - 2)


MINUTES = 60 * 4

def run(n, k):
	count = 0
	minutes_till_end = MINUTES - k
	for i in range(n):
		minutes_till_end -= (i + 1) * 5
		if minutes_till_end < 0:
			return count
		count += 1
	return count

def run_input():
	inp = str(input()).split()
	n = int(inp[0])
	k = int(inp[1])
	print(run(n, k))
run_input()


(n, k) = map(int, input().split())
time_spent = k
task_count = 0
for i in range(1, n + 1):
	if time_spent + 5 * i <= 240:
		time_spent += 5 * i
		task_count += 1
	else:
		break
print(task_count)


(a, b) = map(int, input().split())
n = (240 - b) // 5
i = 0
while n >= 0:
	i += 1
	n -= i
print(min(i - 1, a))


z = input().split(' ')
y = 240 - int(z[1])
x = int(z[0])
i = 1
j = 0
while y >= j:
	j += 5 * i
	i += 1
i -= 1
if i > x:
	print(x)
else:
	print(i - 1)


(n, k) = input().split()
n = int(n)
k = int(k)
c = 240
b = c - k
x = 0
q = list(range(0, n + 1))
e = []
for i in q:
	x = x + i * 5
	if x <= b:
		e.append(i)
print(*e[-1:])


(n, m) = [int(x) for x in input().split()]
ans = 0
for i in range(1, n + 1):
	if m + i * 5 <= 240:
		m += i * 5
		ans += 1
print(ans)


w = input().split()
x = int(w[0])
k = int(w[1])
sum = 0
n = 1
count = 0
while sum + k <= 240 and count < x:
	if sum + k + 5 * n > 240:
		break
	sum += 5 * n
	count += 1
	n += 1
print(count)


(n, k) = map(int, input().split(' '))
res = 240 - k
ans = 0
for i in range(1, n + 1):
	res = res - 5 * i
	if res == 0:
		ans = i
		break
	elif res < 0:
		ans = i - 1
		break
	else:
		ans = n
print(ans)


(a, b) = map(int, input().split())
b = 240 - b
c = 0
for i in range(a):
	if b - (i + 1) * 5 >= 0:
		c += 1
		b -= (i + 1) * 5
print(c)


n = list(map(int, input().split()))
t = 4 * 60 - n[1]
w = 0
for i in range(1, n[0] + 1):
	w = w + i * 5
	if w > t:
		print(i - 1)
		break
	elif w == t:
		print(i)
		break
if w < t:
	print(n[0])


(n, k) = map(int, input().split())
time = 240 - k
if not 5 * (n + 1) * n // 2 > time:
	print(n)
else:
	number = 1
	while not time < 0:
		time -= 5 * number
		number += 1
	if time > 0:
		print(number - 1)
	else:
		print(number - 2)


(n, k) = map(int, input().split())
m = 4 * 60 - k
while n:
	if 5 * n * (n + 1) / 2 > m:
		n -= 1
	else:
		break
print(n)


(n, k) = [int(x) for x in input().split()]
s = 0
flag = 0
for i in range(1, n + 1):
	s += 5 * i
	if s > 240 - k:
		flag = 1
		break
if flag == 1:
	print(i - 1)
else:
	print(n)


s = input().split(' ')
n = int(s[0])
k = int(s[1])
ans = 0
p = 0
for i in range(n):
	p += (i + 1) * 5
	if p <= 4 * 60 - k:
		ans += 1
	else:
		break
print(ans)


n_minutes = 240
(a, b) = [int(x) for x in input().split()]
n_minutes -= b
n = 0
time_cost = 5
while n_minutes >= time_cost and n < a:
	n_minutes -= time_cost
	time_cost += 5
	n += 1
print(n)


__author__ = 'yiyi'
(n, k) = map(int, input().split())
m = 4 * 60 - k
t = 0
if m <= 0:
	print(0)
	exit()
for i in range(n):
	t += 1
	m -= 5 * t
	if m < 0:
		t -= 1
		break
print(t)


(n, k) = [int(x) for x in input().split()]
max_problems = 0
time_left = 240 - k
while max_problems < n:
	time_left -= 5 * (max_problems + 1)
	if time_left >= 0:
		max_problems += 1
	else:
		break
print(max_problems)


(a, k) = map(int, input().split())
time = 240 - k
initiate = 0
for i in range(1, a + 1):
	initiate += 5 * i
	if initiate > time:
		print(i - 1)
		break
	elif i == a:
		print(a)
		break
	else:
		pass


def r():
	return list(map(int, input().split()))
(n, k) = r()
m = 240
count = 0
for i in range(1, n + 1):
	if 5 * i + k > m:
		break
	count += 1
	k += 5 * i
print(count)


(n, k) = map(int, input().split())
k = 240 - k
s = 0
while k >= (s + 1) * 5:
	s += 1
	k -= s * 5
print(min(s, n))


(n, k) = map(int, input().split())
total_time = 240
remaining_time = total_time - k
result = 0
for i in range(1, n + 1, 1):
	if remaining_time - 5 * i >= 0:
		remaining_time -= 5 * i
		result += 1
	else:
		break
print(result)


(question, time) = map(int, input().split())
while question * (question + 1) // 2 * 5 > 240 - time:
	question -= 1
print(question)


(n, k) = map(int, input().split())
time = 240
count = 0
for i in range(1, n + 1):
	k += 5 * i
	if k < 241:
		count += 1
print(count)


(n, k) = map(int, input().split())
time = 240 - k
ctr = 0
for i in range(1, n + 1):
	if time - i * 5 >= 0:
		time -= i * 5
		ctr += 1
	else:
		break
print(ctr)


(n, k) = map(lambda x: int(x), input().split())
c = 240 - k
d = 0
a = 0
while a <= c:
	d += 1
	a = a + 5 * d
if d > n:
	print(n)
else:
	print(d - 1)


(x, y) = map(int, input().split())
z = 0
i = 0
a = 240 - y
output = 0
while i < x:
	i += 1
	z += i * 5
	if a >= z:
		output += 1
print(output)


(n, k) = map(int, input().split())
count = 0
ans1 = 240 - k
ans2 = 0
for i in range(1, n + 1):
	ans2 += 5 * i
	if ans1 >= ans2:
		count += 1
print(count)


(n, k) = [int(i) for i in input().split()]
m = 240 - k
p = 0
while p < n and m > 0:
	m -= (p + 1) * 5
	if m >= 0:
		p += 1
print(p)


(n, k) = map(int, input().split())
i = 0
if k + (i + 1) * 5 > 240:
	print(i)
else:
	while k < 240:
		i += 1
		k = k + i * 5
		if k + (i + 1) * 5 > 240 or i >= n:
			break
	print(i)


(n, k) = map(int, input().split())
r = 240 - k
su = 0
h = 0
for i in range(1, n + 2):
	su = su + 5 * i
	if su > r:
		print(i - 1)
		h = 1
		break
if h == 0:
	print(n)


(n, k) = map(int, input().split())
k = 240 - k
temp = 0
for i in range(1, n + 1):
	temp = temp + 5 * i
	if temp > k:
		i = i - 1
		break
print(i)


(n, k) = input().split()
n = int(n)
k = int(k)
arr = [5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
t = 240 - k
number = t
low = 0
high = n - 1
while low <= high:
	mid = (low + high) // 2
	if number < arr[mid]:
		high = mid - 1
	elif number > arr[mid]:
		low = mid + 1
	else:
		print(mid + 1)
		break
else:
	print(low)


(n, k) = map(int, input().split())
i = 0
time = 240 - k
while time >= (i + 1) * 5:
	if i == n:
		break
	i += 1
	time -= i * 5
print(i)


def accSum(n):
	return (5 * n * n + 5 * n) / 2

def binSearch(r, key):
	maxNum = 0
	p = 1
	while p <= r:
		q = (p + r) // 2
		qVal = accSum(q)
		if qVal == key:
			return q
		elif qVal < key:
			maxNum = q
			p = q + 1
		else:
			r = q - 1
	return int(maxNum)
(n, k) = [int(i) for i in input().split()]
print(binSearch(n, 240 - k))


(n, k) = [int(x) for x in input().split()]
num = 0
t = 5 + k
for i in range(2, n + 2):
	if t <= 240:
		num += 1
		t += i * 5
	else:
		num += 0
print(num)


(n, k) = map(int, input().split())
a = 240 - k
c = 0
while c < n:
	c += 1
	a = a - 5 * c
	if a == 0:
		print(c)
		exit()
	elif a < 0:
		print(c - 1)
		exit()
print(n)


(n, k) = map(int, input().split())
x = 240 - k
count = 0
summ = 0
for i in range(1, n + 1):
	y = 5 * i
	summ = summ + y
	if summ <= x:
		count = count + 1
		if i == n and summ <= x:
			print(count)
	else:
		print(count)
		break


import math
(n, k) = map(int, input().split())
x = (-5 + math.pow(25 + 40 * (240 - k), 0.5)) / 10
print(min(n, int(x)))


(n, k) = map(int, input().split())
t = 240 - k
ans = 0
for i in range(n + 1):
	if 2 * t / 5 < i * (i + 1):
		ans = i - 1
		break
	elif i == n:
		ans = i
print(ans)


import math
(n, k) = map(int, input().split())
x = (240 - k) // 5
ans = 0
while x > 0:
	ans += 1
	x -= ans
if x == 0:
	if n < ans:
		print(n)
	else:
		print(ans)
elif x < 0:
	ans -= 1
	if n < ans:
		print(n)
	else:
		print(ans)


(n, m) = map(int, input().split())
(cnt, sum) = (0, 0)
ml = 240 - m
for i in range(1, n + 1):
	sum = sum + i * 5
	if sum <= ml:
		cnt += 1
print(cnt)


(n, k) = map(int, input().split())
flag = 1
for i in range(1, n + 1):
	if i * i + i <= (240 - k) * 0.4 and (i + 1) * (i + 1) + (i + 1) > (240 - k) * 0.4:
		flag = 0
		print(i)
		break
if flag and i * i + i <= (240 - k) * 0.4:
	print(n)
elif flag:
	print(0)


import math
(n, k) = map(int, input().split())
print(min(n, int((-5 + math.sqrt(25 - 40 * (k - 240))) / 10)))


(n, k) = map(int, input().split())
ans = int((240 - k) / 5)
i = 0
while True:
	ans -= i
	if ans < 0:
		print(min(n, i - 1))
		break
	if ans == 0:
		print(min(n, i))
		break
	i += 1


(n, m) = map(int, input().split())
a = 0
b = 0
h = 240 - m
for i in range(1, n + 1):
	a = a + 5 * i
	if a <= h:
		b = b + 1
print(b)


a = list(map(int, input().split()))
t = 240 - a[1]
b = 0
i = 0
if t < 5:
	print('0')
else:
	while b <= t:
		i += 1
		b += i * 5
	if i - 1 > a[0]:
		print(a[0])
	else:
		print(i - 1)


(n, m) = map(int, input().split())
for i in range(n + 1):
	if i * (i + 1) // 2 * 5 + m <= 240:
		r = i
print(r)


t = input()
(n, k) = [int(i) for i in t.split()]
l = int(2.5 * n * (n + 1)) + k
if l <= 240:
	print(n)
else:
	for j in range(1, n + 1):
		s = 2.5 * j * (j + 1)
		if s + k > 240:
			print(j - 1)
			break


s = input()
s = s.split()
s = [int(x) for x in s]
n = s[0]
k = s[1]
i = 1
t = 240 - k
while t >= 5 * i and i <= n:
	t = t - 5 * i
	i = i + 1
print(i - 1)


(q, time_to_home) = [int(x) for x in input().split()]
time_left = 240 - time_to_home

def pidorskie_zadachi():
	result = 0
	for i in range(1, q + 1):
		result = result + 5 * i
		if result > time_left:
			return i - 1
	return q
print(pidorskie_zadachi())


(n, k) = map(int, input().strip().split())
output = False
time = [5 * i for i in range(1, n + 1)]
timeLeft = 240 - k
if timeLeft == 0:
	print(0)
else:
	for i in range(n - 1, -1, -1):
		timeTaken = sum(time[0:i + 1])
		if timeTaken <= timeLeft:
			output = True
			print(i + 1)
			break
	if not output:
		print(0)


(n, k) = map(int, input().split())
t = 240 - k
p = t // 5
s = 0
i = 1
while i <= n:
	s += i
	if s > p:
		break
	i += 1
print(i - 1)


(n, k) = [int(j) for j in input().split(' ')]
time = 240 - k
p = 0
while p * (p + 1) * 5 <= 2 * time:
	p += 1
print(min(n, p - 1))


(n, k) = list(map(int, input().split()))
left = 0
right = n
while left < right:
	mid = (left + right + 1) // 2
	t = 5 * mid * (mid + 1) // 2
	if t <= 240 - k:
		left = mid
	else:
		right = mid - 1
print(left)


(n, t) = map(int, input().split())
total = 240
l = 240 - t
count = 0
for i in range(1, n + 1):
	l = l - 5 * i
	if l >= 0:
		count += 1
print(count)


(n, k) = map(int, input().split())
time1 = []
while n > 0:
	time1.append(5 * n)
	n -= 1
time1.sort()
all_time = 240 - k
count = 0
while all_time and time1:
	all_time = all_time - time1[0]
	if all_time < 0:
		break
	time1 = time1[1:]
	count += 1
print(count)


(n, k) = list(map(int, input().split()))
res = 0
cur = 60 * 4
for i in range(1, n + 1):
	if cur - 5 * i >= k:
		res += 1
		cur -= 5 * i
	else:
		break
print(res)


a = input().split()
b = int(a[0])
c = int(a[1])
d = 240 - c
i = 1
j = 0
k = 0
while i <= b:
	k = k + 5 * i
	if k > d:
		break
	j = j + 1
	i = i + 1
print(j)


(n, k) = map(int, input().split())
q = 240 - k
i = 1
while q >= 0:
	q -= 5 * i
	i += 1
if i - 2 > n:
	print(n)
else:
	print(i - 2)


(a, b) = [int(i) for i in input().split()]
z = 240 - b
m = 0
t = 0
if z < 5:
	print(0)
else:
	t = 0
	for i in range(1, a + 1):
		m = m + i * 5
		if m > z:
			break
		else:
			t = t + 1
	print(t)


(n, k) = map(int, input().split())
current = 0
for i in range(1, n + 1):
	current += 5 * i
	if 60 * 4 - current - k < 0:
		print(i - 1)
		return
print(n)


import math

def main():
	(n, k) = list(map(int, input().split()))
	time = (240 - k) // 5
	m = int((-1 + math.sqrt(1 + 8 * time)) // 2)
	if n <= m:
		m = n
	print(m)
main()


(n, k) = map(int, input().split())
pure = 240 - k
i = 1
problems = 0
while pure >= 5 * i:
	problems += 1
	pure -= 5 * i
	i += 1
print(min(problems, n))


import sys

def main():
	issues = [0] * 11
	for i in range(1, 11):
		issues[i] = issues[i - 1] + i * 5
	(n, k) = map(int, input().split())
	k = 240 - k
	i = 1
	while issues[i] <= k and i <= n:
		i += 1
	print(i - 1)
sys.exit(main())


(n, m) = map(int, input().split())
l = 1
while m <= 240 and l <= m and (l - 1 <= n):
	m += 5 * l
	l += 1
print(l - 2)


import math
(n, k) = [int(item) for item in input().split()]
r = 240 - k
i = 0
while 5 * i * (i + 1) // 2 <= r:
	i += 1
print(min(n, i - 1))


(n, k) = map(int, input().split())
k = 240 - k
l = 0
z = 1
while k > 0:
	k -= 5 * z
	z += 1
	l += 1
	if k < 0:
		l -= 1
		break
if l >= n:
	print(n)
else:
	print(l)


from sys import *
from decimal import *
from math import *
(n, m) = (int(z) for z in stdin.readline().split())
tim = 240
tt = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
for i in range(n, -1, -1):
	if sum(tt[:i]) + m <= tim:
		print(i)
		exit(0)
print(0)


def inpNum():
	return int(input())

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

def inpList():
	return list(map(int, input().split()))
(n, k) = inpNums()
ti = [5]
for i in range(2, n + 1):
	ti.append(ti[-1] + i * 5)
total = 4 * 60
total -= k
l = 0
r = n - 1
ans = None
while l <= r:
	m = l + (r - l) // 2
	if total == ti[m]:
		ans = m + 1
		break
	elif total > ti[m]:
		l = m + 1
	else:
		r = m - 1
print(ans if ans else r + 1)


(a, b) = map(int, input().split())
k = a
for i in range(1, a + 2):
	if 240 - b - 5 * i >= 0:
		b += 5 * i
	else:
		k = i - 1
		break
print(k)


(n, k) = map(int, input().split())
left = 240 - k
_sum = 0
for i in range(1, n + 3):
	_sum += 5 * i
	if _sum > left:
		break
print(min(i - 1, n))


(a, b) = map(int, input().split())
count = 0
x = 0
for i in range(1, a + 1):
	count += i
	if 5 * count <= 240 - b:
		x = i
print(x)


(n, t) = map(int, input().split())
x = 240 - t
(i, c) = (5, 0)
while x > 0 and n > 0:
	c = c + 1
	x = x - i
	n = n - 1
	i = i + 5
if x >= 0:
	print(c)
else:
	print(c - 1)


def is_Possible(n, k):
	s = 0
	for i in range(1, n + 1):
		s += i * 5
	if s + k <= 240:
		return True
	else:
		return False

def binarySearch(n, k):
	l = 0
	r = n
	ans = -1
	while l <= r:
		mid = l + (r - l) // 2
		if is_Possible(mid, k):
			ans = mid
			l = mid + 1
		else:
			r = mid - 1
	return ans
(n, k) = map(int, input().split())
print(binarySearch(n, k))


(n, k) = map(int, input().split())
A = 240
W = 240 - k
Sum = 0
for i in range(1, n + 1):
	Sum = 5 * i + Sum
	if Sum > W:
		print(i - 1)
		break
if i == n and Sum <= W:
	print(i)


(n, k) = map(int, input().split())
ans = 0
t = 0
while t <= 240 - k:
	ans += 1
	t += 5 * ans
print(min(n, ans - 1))


(n, k) = map(int, input().split())
time = (240 - k) // 5
d = 1 + 8 * time
ans = (-1 + d ** 0.5) / 2
print(min(int(ans), n))


(n, k) = map(int, input().strip().split(' '))
dif = 240 - k
q = 0
while dif >= 0 and q <= n:
	q += 1
	dif -= 5 * q
print(q - 1)


k = list(map(int, input().split()))
(s, t) = (0, 0)
n = k[0]
for i in range(k[0]):
	s = s + 5
	t = s + t
t = t + k[1]
for i in range(k[0]):
	if t <= 240:
		break
	else:
		t = t - 5 * n
		n = n - 1
print(n)


(n, k) = map(int, input().split())
tz = 60 * 4 - k
cp = 1
while tz >= cp * 5 and cp <= n:
	tz = tz - cp * 5
	cp = cp + 1
print(cp - 1)


a = list((int(x) for x in input().split()))
tl = int(240 - a[1])
q = 0
for i in range(a[0]):
	if tl >= 5 * (i + 1):
		tl = tl - 5 * (i + 1)
		q += 1
	else:
		break
print(q)


(n, k) = map(int, input().split())
k = 240 - k
x = 0
while not 5 * (x + 1) * x / 2 > k:
	x += 1
x -= 1
if x <= n:
	print(x)
else:
	print(n)


(n, k) = map(int, input().strip().split())
rem_time = 240 - k
i = 1
count = 0
while rem_time - i * 5 >= 0 and i <= n:
	rem_time -= i * 5
	i += 1
	count += 1
print(count)


(n, k) = map(int, input().split())
p = 240 - k
h = 0
for i in range(1, n + 1):
	p = p - i * 5
	if p >= 0:
		h = h + 1
print(h)


(n, k) = map(int, input().split(' '))
time_rem = 240 - k
if time_rem < 5:
	qs = 0
elif time_rem < 15:
	qs = 1
elif time_rem < 30:
	qs = 2
elif time_rem < 50:
	qs = 3
elif time_rem < 75:
	qs = 4
elif time_rem < 105:
	qs = 5
elif time_rem < 140:
	qs = 6
elif time_rem < 180:
	qs = 7
elif time_rem < 225:
	qs = 8
else:
	qs = 9
print(min(qs, n))


def to_int(a):
	return int(a)
(n, k) = list(map(to_int, input().split()))
total_time = 60 * 4 - k
flag = 0
ans = 0
for i in range(n):
	sum = 5 * ((i + 1) * (i + 2)) / 2
	if sum > total_time:
		flag = 1
		ans = i
		break
if flag == 0:
	print(n)
else:
	print(ans)


def main():
	(n, k) = list(map(int, input().split()))
	(zad, f) = (0, 0)
	for i in range(1, n + 1):
		f += i * 5
		if k + f > 240:
			break
		else:
			zad += 1
	print(zad)
main()


import math
(n, t) = map(int, input().split())
print(min(n, int((math.sqrt(1 + 4 * (96 - 2 * t / 5)) - 1) // 2)))


import os
import sys
from io import BytesIO, IOBase

def main():
	(n, k) = map(int, input().split(' '))
	pre = [0]
	curr = 0
	for x in range(1, n + 1):
		curr += 5 * x
		pre.append(curr)
	low = 1
	high = n
	ans = 240 - k
	if ans < pre[low]:
		print(0)
		return
	while low <= high:
		mid = (low + high) // 2
		if pre[mid] == ans:
			break
		if mid != high and pre[mid] < ans and (pre[mid + 1] > ans):
			break
		if pre[mid] > ans:
			high = mid - 1
		else:
			low = mid + 1
	print(mid)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(n, k) = map(int, input().split())
totalTime = 240
timeTaken = 0
count = 0
for i in range(1, n + 1):
	timeTaken = timeTaken + i * 5
	if timeTaken + k <= 240:
		count = count + 1
print(count)


def gogo(n, k):
	start = 1200
	end = 1440 - k
	count = 0
	for i in range(1, n + 1):
		if start + 5 * i > end or start == end:
			return count
		start += 5 * i
		count += 1
	return count

def main():
	(n, k) = map(int, input().split())
	print(gogo(n, k))
main()


(n, k) = map(int, input().split())
time = 240 - k
i = 1
count = 0
while time >= 0:
	time = time - 5 * i
	i = i + 1
	if time >= 0:
		count = count + 1
	else:
		pass
if count > n:
	print(n)
else:
	print(count)


(n, m) = [int(i) for i in input().split()]
m = 240 - m
nd = 0
i = 1
while True:
	m = m - i * 5
	if m < 0:
		break
	else:
		nd += 1
		i += 1
if nd >= n:
	print(n)
else:
	print(nd)


(n, k) = list(map(int, input().split()))
time_left = 240 - k
time = 0
for i in range(n + 2):
	if time <= time_left:
		time += 5 * (i + 1)
	else:
		break
print(i - 1)


(a, b) = map(int, input().split())
c = 0
d = 1
f = 0
while c <= 240 - b:
	c = d * 5 + c
	d += 1
	f += 1
f = f - 1
if f < a:
	print(f)
else:
	print(a)


(n, k) = map(int, input().split())
s = 0
ret = 0
for i in range(0, n + 1):
	s += 5 * i
	if k + s <= 240:
		ret = i
print(ret)


(n, k) = [int(elem) for elem in input().split()]
time = 60 * 4 - k
counter = 0
while n > 0 and time >= 0:
	counter += 1
	time -= counter * 5
	if time < 0:
		counter -= 1
		break
	n -= 1
print(counter)


(x, y) = map(int, input('').split())
y = 240 - y
z = int(y * 2 / 5)
j = 0
while z > j * (j + 1):
	j = j + 1
if j > x:
	print(x)
elif z == j * (j + 1):
	print(j)
else:
	print(j - 1)


def req(m):
	return int(2.5 * m * (m + 1))
flag = True
(m, n) = map(int, input().split())
remain = 240 - n
if remain >= req(m):
	print(m)
else:
	while flag:
		m -= 1
		if remain >= req(m):
			print(m)
			flag = False


(n, k) = map(int, input().split())
i = 5 * n + 5
if n % 2 == 0:
	t = i * (n // 2)
else:
	t = i * (n // 2) + i // 2
if t <= 240 - k:
	print(n)
else:
	j = 1
	tt = 0
	while j < n:
		tt = tt + j * 5
		if tt <= 240 - k:
			j = j + 1
		else:
			break
	print(j - 1)


(a, b) = map(int, input().split())
ans = 0
sum = b
k = 0
while sum <= 240:
	k = k + 1
	sum = sum + k * 5
	if k > a:
		break
	if sum <= 240:
		ans = ans + 1
print(ans)


import math
(n, k) = map(int, input().split())
t = 240 - k
h = int((math.sqrt(8 * t / 5 + 1) - 1) / 2)
if h > n:
	print(n)
else:
	print(h)


(n, m) = [int(s) for s in input().split(' ')]
time = 240 - m
total = 0
result = 0
for i in range(1, n + 1):
	total += i * 5
	if total > time:
		result = i - 1
		break
	else:
		result += 1
print(result)


(n, k) = map(int, input().split())
contest = 0
time = 240 - k
while time > 0 and n > 0:
	contest += 1
	n -= 1
	time -= 5 * contest
if time >= 0:
	print(contest)
else:
	print(contest - 1)


def main():
	(number_of_problem, time_to_friend) = input().split()
	totol_time = 4 * 60
	time_left = totol_time - int(time_to_friend)
	problem_solve = 0
	for i in range(1, int(number_of_problem) + 1):
		if time_left - i * 5 >= 0:
			time_left -= i * 5
			problem_solve += 1
		else:
			break
	print(problem_solve)
main()


(n, k) = [int(i) for i in input().split()]
limit = 240 - k
time = 5
res = 0
while limit >= time and n > 0:
	limit -= time
	time += 5
	res += 1
	n -= 1
print(str(res))


(n, k) = map(int, input().split())
(answer, time) = (0, 0)
for i in range(1, n + 1):
	if time + i * 5 + k <= 4 * 60:
		answer += 1
		time += i * 5
	else:
		break
print(answer)


a = list(input().split())
n = int(a[0])
k = int(a[1])
time = 240
availabletime = time - k
i = 0
time4code = 0
count = 0
while n > 0:
	i += 1
	time4code += i * 5
	if availabletime - time4code < 0:
		break
	count += 1
	if availabletime - time4code < (i + 1) * 5:
		break
	n -= 1
print(count)


(n, k) = map(int, input().split())
counter = 0
remaining_time = 240 - k
for i in range(1, n + 1):
	remaining_time -= 5 * i
	if remaining_time >= 0:
		counter += 1
print(counter)


(m, n) = map(int, input().rstrip().split())
total = 240
count = 0
for i in range(1, m + 1):
	count += total - 5 * i >= n
	total -= 5 * i
print(count)


s = input()
lst = s.split()
(n, k) = lst
n = int(n)
k = int(k)
t = 240 - k
i = 0
while t - 5 * (i + 1) >= 0 and i < n:
	i += 1
	t -= 5 * i
print(i)


(n, k) = map(int, input().split())
flag = True
for i in range(n, 0, -1):
	problem = 0
	for j in range(1, i + 1):
		problem += j * 5
	if problem + k <= 240:
		print(i)
		flag = False
		break
if flag:
	print(0)


(n, k) = map(int, input().split())
c = 5
z = 0
for i in range(1, n + 1):
	if c <= 240 - k:
		c += (i + 1) * 5
		z += 1
	else:
		break
print(z)


(a, b) = input().split()
a = int(a)
b = int(b)
n = 0
z = 0
while b <= 240 and z <= a:
	z = z + 1
	n = 5 * z
	b = b + n
print(z - 1)


(n, k) = map(int, input().split())
sol = 0
t = (240 - k) / 5
print(min(n, int((-1 + (1 + 4 * 2 * t) ** 0.5) / 2)))


nk = list(map(int, input().split()))
problems = nk[0]
minutes = nk[-1]
time_allowed = 240 - minutes
count = 0
time = 0
total = 0
for i in range(problems):
	if total > time_allowed:
		break
	time += 5
	total += time
	if total > time_allowed:
		break
	count += 1
print(count)


(hours, time) = map(int, input().split())
q = hours
limit = 240 - time
i = 0
while hours > 0:
	i += 1
	if limit - i * 5 < 0:
		break
	limit -= i * 5
	hours -= 1
print(q - hours)


(n, k) = input().split(' ')
n = int(n)
k = int(k)
total = k
res = 0
for i in range(1, n + 1):
	total += 5 * i
	if total > 240:
		break
	else:
		res += 1
print(res)


line = input().split()
n = int(line[0])
k = int(line[1])
t = 240 - k
cnt = 0
tt = 0
while tt <= t:
	cnt = cnt + 1
	tt = tt + 5 * cnt
if cnt > n:
	print(n)
else:
	print(cnt - 1)


(n, k) = map(int, input().split())
num = 240 - k
ans = 0
while num > 0:
	ans += 1
	num -= ans * 5
ans -= 1
if num == 0:
	ans += 1
print(min(ans, n))


Input = input()
Input = Input.split(' ')
time = 240 - int(Input[1])
c = 0
if int(Input[1]) >= 1 and int(Input[0]) <= 10 and (int(Input[0]) >= 1) and (int(Input[1]) <= 240):
	for i in range(1, int(Input[0]) + 1):
		if time - i * 5 >= 0:
			time -= i * 5
			c += 1
	print(c)


(n, l) = map(int, input().split())
l = 240 - l
co = 0
for i in range(2, n + 2):
	ans = i * (i - 1) // 2 * 5
	if ans > l:
		break
	co += 1
print(co)


(n, k) = input().split()
n = int(n)
k = int(k)
l = 60 * 4 - k
c = 0
i = 1
while l > 0 and i <= n:
	c += 1
	l = l - 5 * i
	i += 1
if l < 0:
	c -= 1
print(c)


[n, k] = [int(i) for i in input().split()]
h = 240 - k
count = 0
for i in range(1, n + 1):
	h -= i * 5
	count += 1
	if h < 0:
		count -= 1
		break
print(count)


(a, b) = map(int, input().split())
time = 240 - b
i = 0
while time >= 5 * (i + 1) and i < a:
	i = i + 1
	time = time - 5 * i
print(i)


def main():
	try:
		while True:
			(n, k) = list(map(int, input().split()))
			time = 240 - k
			result = 0
			for i in range(1, n + 1):
				if time < 5 * i:
					break
				time -= 5 * i
				result += 1
			print(result)
	except EOFError:
		pass
main()


(n, k) = map(int, input().split())
rem = (240 - k) / 5
c = 0
for i in range(1, n + 1):
	if rem >= i * (i + 1) / 2:
		c = i
print(c)


(n, k) = map(int, input().split())
t = 0
while t < n:
	if 240 - (k + (t + 1) * 5) >= 0:
		t += 1
		k = k + t * 5
	else:
		break
print(t)


n = [int(x) for x in input().split()]
timeLeft = 60 * 4 - n[1]
count = 0
while timeLeft >= 5 and count < n[0]:
	if timeLeft - (count + 1) * 5 >= 0:
		count += 1
	timeLeft -= count * 5
print(count)


(task, time) = list(map(int, input().split()))
baki = 240 - time
count = 0
total = 0
for i in range(1, task + 1):
	total += i * 5
	if total <= baki:
		count += 1
	else:
		break
print(count)


(n, k) = input().split()
(n, k) = (int(n), int(k))
count_of_problem_can_be_solved = 0
for i in range(n):
	count_of_problem_can_be_solved += 1
	k += 5 * count_of_problem_can_be_solved
	if k > 240:
		count_of_problem_can_be_solved -= 1
		break
print(count_of_problem_can_be_solved)


(n, m) = map(int, input().split())
time = 240 - m
i = 1
count = 0
while 5 * i <= time:
	if i > n:
		break
	time -= 5 * i
	i += 1
	count += 1
print(count)


a = input()
b = a.split()
n = int(b[0])
m = int(b[1])
time = 240 - m
count = 0
cou = 0
for i in range(n):
	if cou < time:
		cou += 5 * (i + 1)
		count += 1
if cou == time or cou < time:
	print(count)
if cou > time:
	print(count - 1)


(n, k) = map(int, input().split())
s = 240 - k
i = 1
while i > 0:
	s = s - 5 * i
	if s > 0:
		i = i + 1
	elif s == 0:
		print(min(i, n))
		break
	else:
		print(min(i - 1, n))
		break


(n, k) = map(int, input().split())
left = 240 - k
p = 0
total = [5 * i * (i + 1) // 2 for i in range(1, n + 1)]
for each in total:
	if each <= left:
		p = total.index(each) + 1
print(p)


(n, k) = list(map(int, input().split()))
s = 0
i = 0
t = (240 - k) // 5
while s <= t:
	i += 1
	s += i
print(min(n, i - 1))


(n, k) = map(int, input().split())
i = 0
x = 0
total = k
while total <= 240 and i < n:
	i = i + 1
	x = x + 5 * i
	total = x + k
	if total > 240:
		i -= 1
print(i)


(n, k) = map(int, input().split())
rem = 240
rem -= k
z = 5
ans = 0
while n > 0 and rem - z >= 0:
	rem -= z
	ans += 1
	n -= 1
	z += 5
print(ans)


(n, k) = map(int, input().split())
i = 1
t = 5
while t <= 4 * 60 - k and i <= n:
	i += 1
	t += 5 * i
print(i - 1)


string = input().split()
n = int(string[0])
k = int(string[1])
cnt = 0
time = 0
while time <= 4 * 60 - k and cnt <= n:
	cnt += 1
	time += 5 * cnt
cnt -= 1
print(cnt)


(q, p) = map(int, input().split())
time = 240
rt = time - p
temp = 0
sum = 0
for i in range(q):
	temp = temp + 5
	sum = sum + temp
for j in range(rt):
	if rt % 5 != 0:
		rt = rt - 1
count = 0
t1 = 0
s1 = 0
for k in range(q):
	t1 = t1 + 5
	s1 = s1 + t1
	for a in range(rt + 1):
		if s1 == a:
			count = count + 1
print(count)


(n, k) = map(int, input().split())
remain = 240 - k
prob_solved = 0
res = 0
for i in range(1, n + 1):
	prob_solved = prob_solved + i * 5
	if prob_solved <= remain:
		res = i
		continue
	else:
		res = i - 1
		break
print(res)


def s():
	(n, k) = [int(x) for x in input().split(' ')]
	t = 240 - k
	ans = 0
	for i in range(1, n + 1):
		t -= i * 5
		if t < 0:
			break
		ans += 1
	print(ans)
s()


s = str(input()).split()
n = int(s[0])
k = int(s[1])
s = 240 - k
c = 0
while s - 5 * c >= 0:
	s = s - 5 * c
	c += 1
c -= 1
if c > n:
	print(n)
else:
	print(c)


(n, k) = map(int, input().split())
init = 5
time = []
time.append(0)
for i in range(1, n + 1):
	time.append(i * init + time[i - 1])
count = 0
for times in time:
	if times > 240 - k:
		break
	else:
		count += 1
print(count - 1)


(n, t) = map(int, input().split())
t = 240 - t
print(sum((5 * i * (1 + i) / 2 <= t for i in range(1, min(11, n + 1)))))


(n, k) = map(int, input().split())
w = 5
i = 0
while True:
	i += 1
	k += w * i
	if k > 240:
		i -= 1
		break
	else:
		pass
print(min(i, n))


def main():
	(n, k) = [int(a) for a in input().split(' ')]
	for i in range(n, -1, -1):
		t = 0
		for j in range(i + 1):
			t += 5 * j
		if t + k <= 240:
			print(i)
			break
main()


(n, k) = [int(i) for i in input().split()]
maxm = 240 - k
a = [5 * (i + 1) for i in range(n)]
ans = 0
for i in range(n):
	if sum(a[:i + 1]) <= maxm:
		ans += 1
	else:
		break
print(ans)


(n, k) = map(int, input().split())
cost = 5
total_time = k
res = 0
while total_time + cost <= 240 and res <= n:
	res += 1
	total_time += cost
	cost += 5
print(min(res, n))


(n, k) = [int(x) for x in input().split()]
timehehas = 240 - k
answer = 0
nexttime = 5
while nexttime <= timehehas:
	answer += 1
	timehehas -= nexttime
	nexttime += 5
if answer > n:
	print(n)
else:
	print(answer)


l = list(map(int, input().split()))
m = 240 - l[1]
x = l[0]
p = 0
i = 1
c = 0
while i <= x:
	if p + i * 5 > m:
		break
	p = p + i * 5
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
while n * (n + 1) // 2 * 5 > 240 - k:
	n = n - 1
print(n)


from math import floor, ceil, log

def main():
	(n, k) = map(int, input().split())
	left = 240 - k
	minUsed = 0
	tasks = 0
	while minUsed + (tasks + 1) * 5 <= left and tasks < n:
		minUsed += (tasks + 1) * 5
		tasks += 1
	print(tasks)
main()


(n, k) = map(int, input().split())
svob = 240 - k
kol = 0
for i in range(1, n + 1):
	svob -= 5 * i
	if svob >= 0:
		kol += 1
	else:
		break
print(kol)


import math
(n, k) = map(int, input().split())
tleft = (240 - k) * 0.4
if n * (n + 1) <= tleft:
	ans = n
else:
	ans = math.floor(-0.5 + 0.5 * (1 + 4 * tleft) ** 0.5)
print(ans)


(n, k) = map(int, input().split())
timeLeft = 240 - k
c = 0
timeTaken = 5
j = 2
for i in range(n):
	if timeTaken <= timeLeft:
		c = c + 1
		timeTaken = timeTaken + 5 * j
		j = j + 1
print(c)


(n, k) = list(map(int, input().strip().split(' ')))
arr = [5 * i for i in range(1, n + 1)]
sum2 = sum(arr)
sum1 = 240 - sum2
count = n
for i in reversed(arr):
	if sum1 >= k:
		break
	sum2 = sum2 - i
	sum1 = 240 - sum2
	count -= 1
print(count)


(n, k) = map(int, input().split())
re = k % 60
k = k - re
h = k // 60
h = 4 - h
if re != 0:
	h = h - 1
	m = 60 - re
else:
	m = 0
cou = 0
m1 = 0
h1 = 0
for i in range(1, n + 1):
	if i * 5 >= 60:
		h1 = i * 5 // 60
		m1 = i * 5 % 60
	else:
		m1 = i * 5
	if m < m1 and h > 0:
		m += 60
		h -= 1
	m = m - m1
	h = h - h1
	if h <= 0 and m < 0:
		break
	else:
		cou += 1
print(cou)


def solve(n, k):
	s = 0
	count = 0
	t = 240 - k
	for i in range(n):
		s += (i + 1) * 5
		if s > t:
			break
		count += 1
	return count
(n, k) = map(int, input().split())
print(solve(n, k))


(n, k) = list(map(int, input().split()))
a = 0
ind = 0
while a <= 240 - k and ind <= n:
	a += ind * 5 + 5
	ind += 1
a -= ind * 5
print(ind - 1)


(n, k) = map(int, input().split())
tot_h = 4 * 60
tot_h -= k
tot = 0
for _ in range(1, n + 1):
	tot_h -= _ * 5
	if tot_h >= 0:
		tot += 1
print(tot)


(n, k) = map(int, input().split())
y = 240 - k
res = 0
que = 0
for i in range(1, n + 1):
	c = 5 * i
	res += c
	if res <= y:
		que += 1
	if res > y:
		break
print(que)


(n, k) = list(map(int, input().split()))
total_minutes = 240
have_time = total_minutes - k
task = 1
time_need = 5
while have_time > time_need and task < n:
	have_time = have_time - time_need
	task = task + 1
	time_need = task * 5
if task > n:
	print(n)
elif time_need > have_time:
	print(task - 1)
else:
	print(task)


(a, b) = map(int, input().split())
c = 1
while b <= 240 and c <= b and (c - 1 <= a):
	b += 5 * c
	c += 1
print(c - 2)


(n, k) = list(map(int, input().split()))
k = 240 - k
time_i = 0
count = 0
for i in range(1, n + 1):
	if time_i + 5 * i > k:
		break
	else:
		time_i += 5 * i
		count += 1
print(count)


(n, k) = map(int, input().split())
t = 0
i = 1
while t <= 240 - k and i <= n:
	t = t + i * 5
	if t == 240 - k:
		print(i)
		break
	elif t > 240 - k and t != 240 - k:
		print(i - 1)
		break
	elif i == n:
		print(n)
		break
	else:
		i += 1


(n, k) = [int(i) for i in input().split()]
t = 240 - k
i = 0
while i <= n:
	i += 1
	t -= i * 5
	if t < 0:
		i -= 1
		break
print(min(i, n))


(n, k) = [int(x) for x in input().split()]
ans = 0
sum = k
for i in range(1, n + 1):
	if sum + i * 5 > 240:
		break
	sum += i * 5
	ans += 1
print(ans)


(m, n) = input().split()
time = 240 - int(n)
Sum = 0
a = 0
b = 0
for i in range(1, int(m) + 1):
	Sum = Sum + 5 * i
	if Sum > time:
		a = 1
		b = i
		break
if a == 1:
	print(b - 1)
else:
	print(m)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
(N, K) = map(int, input().split())
t = 4 * 60 - K
for i in range(1, N + 1):
	if 5 * (i + 1) * i > 2 * t:
		print(i - 1)
		exit(0)
print(N)


two = input().split()
(n, k) = [int(item) for item in two]
new = 240 - k
problems = 0
arr = []
for item in range(1, n + 1):
	problems += 5 * item
	if problems <= new:
		arr.append(problems)
print(len(arr))


(n, k) = map(int, input().split())
p = 0
for p in range(1, 20):
	k += p * 5
	if k > 240:
		break
print(min(n, p - 1))


(n, k) = map(int, input().split())
a = 240 - k
b = 0
c = 0
d = 0
for i in range(n):
	b = b + 5
	c = a - b
	if c >= 0:
		d += 1
	else:
		break
	a = c
print(d)


s = input().split()
n = int(s[0])
k = int(s[1])
ans = 240 - k
q = 0
for i in range(1, n + 1):
	ans -= i * 5
	if ans < 0:
		break
	q += 1
print(q)


n = input().split()
n = [int(i) for i in n]
time_left = 240 - n[1]
count = 0
for i in range(1, n[0] + 1):
	if time_left > 0:
		time_left -= i * 5
		if time_left >= 0:
			count += 1
		else:
			break
	else:
		break
print(count)


class solution:

	def answer(q, leavetime):
		totaltime = 240
		solve = totaltime - leavetime
		question = [[0, 0]]
		lis = []
		for i in range(1, q + 1):
			question.append([question[-1][-2] + i * 5, i])
		for i in question:
			if i[0] <= solve:
				lis.append(i[1])
		return lis[-1]
(q, leavetime) = input().split()
ans = solution.answer(int(q), int(leavetime))
print(ans)


(n, k) = [int(x) for x in input().split()]
ls = [5 * i for i in range(1, 11)]
for i in range(11):
	if sum(ls[:i]) > 240 - k:
		break
print(min(i - 1, n))


time = [1]
for i in range(1, 10):
	time.append(time[i - 1] + i + 1)
(n, k) = [int(n) for n in input().split()]
rest = int(4 * 60 - k) / 5
m = min(time[n - 1], rest)

def find():
	left = 0
	right = 9
	while left <= right:
		mid = int((left + right) / 2)
		if time[mid] == m:
			return mid
		if time[mid] > m:
			right = mid - 1
			continue
		if time[mid] < m:
			left = mid + 1
	return left + 99
res = find()
if res < 80:
	print(res + 1)
else:
	print(res - 99)


(n, t) = map(int, input().strip().split())
while sum([5 * i for i in range(n + 1)]) > 240 - t:
	n -= 1
print(n)


total = 4 * 60
(n, k) = map(int, input().split())
total -= k
res = 0
while res < n:
	if total < (res + 1) * 5:
		break
	total -= (res + 1) * 5
	res += 1
print(res)


(n, k) = [int(s) for s in input().split()]
counter = 0
time = 0
while time < 240 - k and counter < n:
	counter += 1
	time += 5 * counter
if time > 240 - k:
	print(counter - 1)
else:
	print(counter)


def before_ny(n, k):
	total_time = 240 - k
	count = 0
	for i in range(1, n + 1):
		old_count = count
		count += i * 5
		if count > total_time:
			return i - 1
		elif count == total_time:
			return i
	return i

def main():
	raw = input().split(' ')
	n = int(raw[0])
	k = int(raw[1])
	print(before_ny(n, k))
main()


(n, k) = map(int, input().split())
t = 240 - k
l = 5
c = 0
while t - l >= 0 and c < n:
	c += 1
	t -= l
	l += 5
print(c)


l = [int(i) for i in input().split()]
n = l[0]
k = l[1]
k = 240 - k
dem = 0
for i in range(1, n + 1):
	if k - i * 5 >= 0:
		k = k - i * 5
		dem += 1
print(dem)


(exer, mins) = map(int, input().split())
count_exer = 0
mins_for_ex = 0
for i in range(1, exer + 1):
	mins_for_ex += 5 * i
	if mins + mins_for_ex <= 240:
		count_exer += 1
print(count_exer)


(n, k) = map(int, input().split())
time = 240 - k
ltime = 0
amount = 0
while amount <= n and ltime <= time:
	amount += 1
	ltime += 5 * amount
if amount - 1 > n:
	print(n)
else:
	print(amount - 1)


(n, m) = list(map(int, input().split()))
c = 240 - m
d = 0
for i in range(1, n + 1):
	d += 5 * i
	if d > c:
		print(i - 1)
		break
else:
	print(n)


(x, y) = input().split()
c = 240 - int(y)
if c >= 5:
	n = 5
	count = 1
	while count <= int(x) and n <= c:
		count += 1
		n += count * 5
	print(count - 1)
else:
	print(0)


tt = 4 * 60

def fn(x):
	return 5 * (x + 1) * x // 2

def qt(n, k):
	for x in range(n + 1):
		if fn(x + 1) + k > tt:
			return x
	return n
(n, k) = [int(x) for x in input().split()]
print(qt(n, k))


(q, t) = map(int, input().split(' '))
m = t
c = 0
for i in range(1, q + 1):
	m += 5 * i
	c += 1
	if m > 240:
		m -= 5 * i
		c -= 1
print(c)


I = lambda : map(int, input().split())
(n, min) = I()
min = 240 - min
t = 1
s = 0
ans = 0
while t != 0:
	s = s + 5 * t
	t = t + 1
	if s <= min:
		ans += 1
	else:
		break
if n >= ans:
	print(ans)
else:
	print(n)


(n, k) = map(int, input().split())
available_time = 240 - k
count = 0
for i in range(1, n + 1):
	solving_time = 5 * i
	if solving_time <= available_time:
		count += 1
		available_time = available_time - solving_time
print(count)


x = 4 * 60
raw_inp = input().split(' ')
inp = [int(i) for i in raw_inp]
x -= inp[1]
n = inp[0]
l = 0
r = n

def get_time(k):
	return k * (k + 1) // 2 * 5
while r > l:
	mid = (l + r + 1) // 2
	time = get_time(mid)
	if time <= x:
		l = mid
	else:
		r = mid - 1
print(l)


problem = list(map(int, input().split(' ')))
time = 4 * 60
diff = time - problem[1]
x = 0
for i in range(5, diff + 1, 5):
	if diff >= i and problem[0] > x:
		diff -= i
		x += 1
	else:
		break
print(x)


m = 240
nk = input().split(' ')
n = int(nk[0])
k = int(nk[1])
total = 0
count = 0
for i in range(1, n + 1):
	total += 5 * i
	if total + k <= 240:
		count += 1
	else:
		break
print(count)


(n, m) = map(int, input().split())
i = 0
time = 240 - m
minutes = 0
while minutes < time and i < n:
	i += 1
	minutes += i * 5
	if minutes > time:
		i -= 1
print(i)


(n, k) = map(int, input().split())
realn = 240 - k
realn = int(realn / 5)
while n > 0:
	if n * (n + 1) / 2 <= realn:
		break
	n -= 1
print(n)


(n, k) = map(int, input().split())
remaining_time = 4 * 60 - k
i = 0
while remaining_time >= 5 * (i + 1) and i < n:
	i += 1
	remaining_time -= 5 * i
print(i)


inp = input().split()
(n, k) = (int(inp[0]), int(inp[1]))
time = 4 * 60
time -= k
flag = False
for i in range(1, n + 1):
	if time < 5 * i:
		print(i - 1)
		flag = True
		break
	elif time == 5 * i:
		print(i)
		flag = True
		break
	time -= 5 * i
if not flag:
	print(n)


(n, k) = map(int, input().split())
t = 240 - k
count = 0
ts = 0
for i in range(1, n + 1):
	t1 = 5 * i
	t -= t1
	if t >= 0:
		count += 1
print(count)


(n, k) = [int(x) for x in input().split(' ')]
i = 0
h = 4 * 60 - k
s = 0
while i <= n and h - s >= 0:
	i += 1
	s += 5 * i
print(i - 1)


(n, hrs) = map(int, input().split())
cnt = 0
res = 0
l = []
if hrs > 240:
	print(0)
else:
	for i in range(1, n + 1):
		ans = 5 * i
		hrs += ans
		if hrs <= 240:
			cnt += 1
print(cnt)


ft = 240
(n, st) = map(int, input().split())
c = 0
for i in range(1, n + 1):
	if 5 * i * (i + 1) / 2 <= ft - st:
		c += 1
print(c)


(n, k) = input().split()
n = int(n)
k = int(k)
cnt = 0
i = 1
total = 0
while 1:
	total = total + i * 5
	if total > 240 - k or i > n:
		break
	else:
		cnt = cnt + 1
		i = i + 1
print(cnt)


x = 0
(q, t) = map(int, input().split())
for i in range(1, q + 1):
	x = x + 5 * i
	if x > 240 - t:
		print(i - 1)
		break
if x <= 240 - t:
	print(q)


(n, k) = map(int, input().split())
r = n + 1
l = 0
while r - l > 1:
	m = (r + l) // 2
	j = 0
	for i in range(1, m + 1):
		j += i * 5
	if j + k <= 4 * 60:
		l = m
	else:
		r = m
print(l)


(n, k) = map(int, input().split())
time_for_solve = 240 - k
if time_for_solve >= n * (n + 1) / 2 * 5:
	print(n)
else:
	for i in range(n + 1):
		if time_for_solve >= i * 5:
			time_for_solve -= i * 5
		else:
			print(i - 1)
			break


(n, k) = map(int, input().split())
a = 240 - k
c = 0
while c < n:
	c += 1
	a -= 5 * c
	if a < 0:
		c -= 1
		break
print(c)


(n, k) = [int(i) for i in input().split()]
time = 240 - k
for i in range(1, n + 1):
	time -= i * 5
	if time < 0:
		print(i - 1)
		break
	elif i == n:
		print(n)
		break


def solve(n, k):
	min_to_midnight = 240
	total = k
	for i in range(1, n + 1):
		this_prob = 5 * i
		if total + this_prob <= min_to_midnight:
			total += this_prob
		else:
			return i - 1
	return n
(n, k) = map(int, input().split(' '))
print(solve(n, k))


inp1 = str(input())
inp = inp1.split()
n = int(inp[0])
k = int(inp[1])
l = 240 - k
count = 0
for i in range(1, n + 1):
	if l >= 5 * i:
		count += 1
		l -= 5 * i
	else:
		break
print(count)


(n, k) = map(int, input().strip().split())
l = 240 - k
p = 0
for i in range(1, n + 1):
	l = l - 5 * i
	if l >= 0:
		p += 1
	else:
		break
print(p)


import math
inn = input()
innn = inn.split()
n = int(innn[0])
k = int(innn[1])
problems = (-1 + math.sqrt(1 + 4 * (2 / 5) * (240 - k))) // 2
if problems < n:
	print(int(problems))
else:
	print(int(n))


(n, k) = list(map(int, input().split()))
mins = 240 - k
cnt = 0
for i in range(n):
	mins -= (i + 1) * 5
	if mins < 0:
		break
	cnt += 1
print(cnt)


def party(n, k):
	k = 240 - k
	i = 1
	probs = 0
	while True:
		k -= 5 * i
		if k < 0:
			break
		i += 1
		probs += 1
	return min(probs, n)
x = list(map(int, input().rstrip().split()))
n = x[0]
k = x[1]
print(party(n, k))


(n, k) = map(int, input().split())
m = 240 - k
for i in range(n + 1):
	a = 5 * i
	m = m - a
	if m < 0:
		break
if m >= 0:
	print(i)
else:
	print(i - 1)


(n, k) = list(map(int, input().split()))
tl = 240 - k
c = 0
for i in range(1, n + 1):
	if tl - 5 * i >= 0:
		tl -= 5 * i
		c += 1
print(c)


x = list(map(int, input().split()))
n = x[0]
k = 240 - x[1]
i = 1
m = 0
p = 0
if k == 0:
	m = 0
else:
	while i <= n:
		if p + 5 * i > k:
			break
		p += 5 * i
		m += 1
		i += 1
print(m)


(a, b) = map(int, input().strip().split())
k = 240 - b
c = 0
i = 1
while k >= 0:
	k = k - 5 * i
	if k >= 0:
		c += 1
	i = i + 1
if c > a:
	c = a
print(c)


maxtime = 240
(problems, triptime) = map(int, input().split())
maxtime = maxtime - triptime
if maxtime < 5:
	print(0)
	exit()
for c in range(1, problems + 1):
	maxtime -= 5 * c
	if maxtime < 5 * (c + 1) or c == problems:
		print(c)
		break


(n, k) = map(int, input().split())
index = -1
k = 240 - k
if k < 5:
	print(0)
else:
	low = 1
	high = n
	while low <= high:
		mid = (low + high) // 2
		if 5 * (mid * (mid + 1) // 2) == k:
			index = mid
			break
		elif 5 * (mid * (mid + 1) // 2) > k:
			high = mid - 1
		else:
			index = mid
			low = mid + 1
	if index == -1:
		print(0)
	else:
		print(index)


(n, k) = map(int, input().split())
t = 4 * 60
t -= k
num = 0
for i in range(1, n + 1):
	if 5 * i <= t:
		num += 1
		t -= 5 * i
print(num)


import sys
inf = float('inf')
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
(mod, MOD) = (1000000007, 998244353)
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, k) = get_ints()
remain = 240 - k
initial = 0
i = 1
while initial + 5 * i <= remain:
	initial += 5 * i
	i += 1
print(min(i - 1, n))


(n, t) = map(int, input().split())
r = 240 - t
c = 0
reqd = 0
a = []
s = []
for i in range(1, n + 1):
	time = 5 * i
	a.append(time)
for i in range(len(a)):
	c = c + a[i]
	s.append(c)
for i in range(len(s)):
	if s[i] <= r:
		reqd = reqd + 1
print(reqd)


a = [int(x) for x in input().split()]
n = a[0]
l = 240 - a[1]
c = 0
i = 1
c1 = 0
while i <= n:
	if c1 + 5 * i <= l:
		c1 = c1 + 5 * i
		c = c + 1
	i = i + 1
print(c)


(n, m) = map(int, input().split())
m = 240 - m
c = 0
while m >= 0 and c <= n:
	c = c + 1
	m = m - 5 * c
print(c - 1)


(n, m) = map(int, input().split())
a = 240 - m
i = 1
k = 0
while a - i * 5 >= 0:
	a = a - i * 5
	k += 1
	i += 1
if k >= n:
	print(n)
else:
	print(k)


(n, k) = list(map(int, input().split()))
c = 0
c2 = 0
f = 1
i = 1
while i <= n and f:
	c += 5 * i
	if c > 240 - k:
		f = 0
	else:
		c2 += 1
	i += 1
print(c2)


nk = input().split(' ')
nk = list(map(int, nk))
trestante = 240 - nk[1]
cont = 0
for i in range(1, nk[0] + 1):
	if trestante < 0 or trestante < 5 * i:
		break
	else:
		trestante = trestante - 5 * i
		cont += 1
print(cont)


(n, k) = map(int, input().split())
t = 240 - k
count = 0
i = 1
while t >= 5 * i and count < n:
	count += 1
	t -= 5 * i
	i += 1
else:
	print(count)


(n, t) = map(int, input().split(' '))
zad = 0
tz = 240 - t
if tz < 5:
	print(0)
else:
	while tz > 0:
		zad += 1
		tz = tz - zad * 5
	if tz == 0:
		zad += 1
	print(min(zad - 1, n))


def ri():
	return map(int, input().split())
(n, k) = ri()
a = 240 - k
for i in range(1, n + 1):
	a = a - i * 5
	if a < 0:
		print(i - 1)
		exit()
print(n)


(n, m) = map(int, input().split())
m = abs(240 - m)
total = 0
count = 0
for i in range(1, n + 2):
	s = i * 5
	if total + s <= m:
		total += s
		count += 1
	else:
		print(count)
		break
else:
	print(n)


ans = 0
t = 4 * 60
(n, k) = map(int, input().split())
for j in range(n):
	t -= 5 * (j + 1)
	if t >= k:
		ans += 1
	else:
		break
print(ans)


b = input().split(' ')
e = int(b[0])
c = int(b[1])
c = 240 - c
i = 0
if c - 5 >= 0:
	c = c - 5
	i = i + 1
if c - 10 >= 0:
	c = c - 10
	i = i + 1
if c - 15 >= 0:
	c = c - 15
	i = i + 1
if c - 20 >= 0:
	c = c - 20
	i = i + 1
if c - 25 >= 0:
	c = c - 25
	i = i + 1
if c - 30 >= 0:
	c = c - 30
	i = i + 1
if c - 35 >= 0:
	c = c - 35
	i = i + 1
if c - 40 >= 0:
	c = c - 40
	i = i + 1
if c - 45 >= 0:
	c = c - 45
	i = i + 1
if i > e:
	print(e)
else:
	print(i)


(n, k) = map(int, input().split())
rem = 240 - k
i = 0
sum = 0
while i <= n and sum < rem:
	i += 1
	sum += i * 5
	if sum > rem:
		break
print(i if sum == rem else i - 1)


(a, b) = map(int, input().split())
time = 240
end = False
pr = 0
pr_time = 0
while end != True:
	if time >= pr_time + b + 5 * (pr + 1):
		pr_time = pr_time + 5 * (pr + 1)
		pr = pr + 1
	else:
		if pr > a:
			pr = a
		end = True
		print(pr)


import sys
(n, k) = map(int, input().split())
time = 4 * 60
left_time = time - k
solved = 0
p = 0
while p <= left_time and solved <= n:
	p += 5 * (solved + 1)
	if p <= left_time and solved < n:
		solved += 1
	else:
		break
print(solved)


a = input()
a = a.split()
b = list()
for x in a:
	b.append(int(x))
x = 240 - b[1]
co = 0
for i in range(1, b[0] + 1):
	d = 5 * i
	if x - d >= 0:
		x = x - d
		co += 1
print(co)


import math
(n, k) = [int(i) for i in input().split()]
print(min(n, int((-1 + math.sqrt(1 + 8 * (240 - k) / 5)) / 2)))


temp = input()
(n, k) = temp.split(' ')
n = int(n)
k = int(k)
rem = 240 - k
count = 0
for i in range(n):
	if rem >= 5 * (i + 1):
		rem = rem - 5 * (i + 1)
		count += 1
	else:
		break
print(count)


value = [i for i in map(int, input().split())]
nub = [i for i in range(1, value[0] + 1)]
if value[1] < 236:
	for i in range(1, len(nub) + 1):
		v = nub[:i]
		if sum(v) * 5 + value[1] <= 240:
			kr = v
	print(len(kr))
else:
	print(0)


(n, k) = map(int, input().split())
left = 240 - k
i = 1
res = 0
while left - 5 * i >= 0:
	res += 1
	left -= 5 * i
	i += 1
print(min(n, res))


(N, K) = map(int, input().split(' '))
tot = 240 - K
ans = 0
totsum = 0
i = 1
while totsum < tot and ans < N:
	totsum += 5 * i
	i += 1
	if totsum <= tot and ans < N:
		ans += 1
print(ans)


def New_Year_and_Hurry(n, k):
	time = 0
	cnt = n
	for i in range(1, n + 1):
		Sum = 5 * (i ** 2 + i) / 2
		time = Sum + k
		if time > 240:
			cnt = i - 1
			break
		elif time == 240:
			cnt = i
			break
	return cnt
(n, k) = map(int, input().split())
print(New_Year_and_Hurry(n, k))


(n, k) = map(int, input().split())
l = [0 for i in range(n)]
for i in range(n):
	l[i] = (i + 1) * 5
c = 0
sum = 240 - k
sums = 0
for i in range(len(l)):
	sums += l[i]
	c += 1
	if sums >= sum:
		break
if sums > sum:
	print(c - 1)
else:
	print(c)


(a, b) = map(int, input().split())
p = 0
cnt = 0
i = 1
if b == 1 and a < 9:
	print(a)
else:
	while b < 240:
		b = b + 5 * i
		i = i + 1
		cnt += 1
	if b > 240 and a >= cnt:
		print(cnt - 1)
	elif cnt > a:
		print(a)
	else:
		print(cnt)


(n, k) = map(int, input().split())
v = 4 * 60 - k
max = 0
for i in range(1, v // 5 + 1):
	if v // 5 - i * (i + 1) // 2 >= 0 and i > max:
		max = i
if max > n:
	print(n)
else:
	print(max)


(m, n) = map(int, input().split())
time = 240 - n
count = 0
i = 1
while time >= 5 * i and i <= m:
	time = time - 5 * i
	count = count + 1
	i = i + 1
print(count)


(n, k) = map(int, input().split())
timeLeft = 240 - k
i = 1
ans = 0
while i <= n:
	if timeLeft < 5 * i:
		break
	timeLeft -= 5 * i
	ans += 1
	i += 1
print(ans)


(n, k) = map(int, input().split())
minutes = 240
total = 0
count = 0
for i in range(1, n + 1):
	x = 5 * i
	total = total + x
	time = minutes - total
	if time >= k:
		count += 1
	else:
		break
print(count)


(a, b) = input().split()
t = 60 * 4 - int(b)
i = 1
count = 0
total = 0
while i <= int(a):
	total += 5 * i
	if total > t:
		break
	else:
		count += 1
	i += 1
print(count)


a = input().split(' ')
a[0] = int(a[0])
a[1] = int(a[1])
m = 240 - a[1]
y = 1
while True:
	m -= y * 5
	if m < 0:
		y -= 1
		break
	y += 1
print(min(a[0], y))


from sys import stdin
_input = stdin.readline
(_range, _int) = (range, int)

def solution():
	(n, k) = [_int(i) for i in _input().split()]
	time = 4 * 60 - k
	ans = 0
	for i in _range(n):
		if (i + 1) * 5 <= time:
			time -= (i + 1) * 5
			ans += 1
		else:
			break
	print(ans)
solution()


[n, k] = list(map(int, input().split()))
res = 0
for x in range(1, n + 1):
	if 5 * x * (x + 1) // 2 + k <= 240:
		res = max(res, x)
print(res)


(n, m) = [int(x) for x in input().split()]
d = 240
s = 0
l = 0
for i in range(1, n + 1):
	s += 5 * i
	if s > d - m:
		break
	l += 1
print(l)


(n, k) = list(map(int, input().split()))
i = 0
t = 0
while t + (i + 1) * 5 + k <= 4 * 60 and i <= n:
	t += (i + 1) * 5
	i += 1
print(min(i, n))


(n_q, g_time) = map(int, input().split())
remaining_time = 60 * 4 - g_time
j = 1
curr_time = 0
res = 0
while curr_time <= remaining_time and res <= n_q:
	curr_time += j * 5
	res += 1
	j += 1
print(res - 1)


(n, k) = list(map(int, input().strip().split()))
time = 240 - k
if time < 5:
	print(0)
else:
	i = 1
	while 5 * (i + 1) * i / 2 <= time and i <= n:
		i += 1
	print(i - 1)


n = list(map(int, input().split()))
sum = 0
i = 0
for num in range(1, n[0] + 1):
	sum = sum + num * 5
	if sum > 240 - n[1]:
		break
	else:
		i += 1
print(i)


(numOfProbs, time) = [int(i) for i in input().split()]
Time = 0
tList = []
for i in range(1, numOfProbs + 1):
	Time += i * 5
	tList.append(i * 5)
totalTime = Time + time
if totalTime <= 240:
	print(numOfProbs)
else:
	while totalTime > 240:
		numOfProbs -= 1
		totalTime -= tList[-1]
		tList.pop()
	print(numOfProbs)


(n, k) = map(int, input().split())
timeleft = 240 - k
counter = 0
for i in range(1, n + 1):
	used = 5 * i
	if timeleft < used:
		break
	else:
		timeleft -= 5 * i
		counter += 1
print(counter)


a = list(map(int, input().split()))
n = a[0]
k = a[1]
tleft = 240 - k
i = 1
while True:
	tleft = tleft - 5 * i
	if tleft <= 0:
		break
	i += 1
if i > n:
	print(n)
elif tleft == 0:
	print(i)
else:
	print(i - 1)


(n, k) = list(map(int, input().split()))
pro = 0
for i in range(1, n + 1):
	if 5 * i * (i + 1) // 2 + k <= 240:
		pro += 1
print(pro)


x = 240
(n, k) = map(int, input().split())
time = x - k
p = 0
q = 0
for a in range(1, n + 1):
	q += 5 * a
	p += 1
	if q >= time:
		if q > time:
			p = p - 1
			print(p)
			quit()
		else:
			print(p)
		quit()
print(p)


from typing import Counter
(n, k) = list(map(int, input().split()))
count = 0
time_left = 240 - k
for i in range(1, n + 1):
	time_per_prob = 5 * i
	if time_left - time_per_prob >= 0:
		time_left -= time_per_prob
		count += 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
(cnt, grab) = (0, 0)
if k == 240:
	print(0)
else:
	for i in range(1, n + 1):
		cnt += i * 5
		if cnt + k <= 240:
			grab = i
	print(grab)


(a, b) = [int(x) for x in input().split()]
c = b
d = 0
for i in range(1, a + 1):
	c = c + 5 * i
	if c <= 240:
		d = d + 1
	if c > 240:
		break
print(d)


(x, y) = input().split(' ')
(x, y) = (int(x), int(y))
(a, b) = (0, 0)
for i in range(x + 1):
	if i > 0:
		a = a + 5 * i
		if 240 - a >= y:
			b += 1
print(b)


import math
(n, k) = map(int, input().split())
timehas = 240 - k
num = math.floor(timehas / 5)
k = 0
i = 0
while k < num and i < n:
	i = i + 1
	k = k + i
if k > num:
	print(i - 1)
else:
	print(i)


import math
(n, k) = map(int, input().split())
k = 240 - k
s = math.trunc((-1 + math.sqrt(1 + 8 / 5 * k)) / 2)
print(s if s < n else n)


import math
(n, k) = input().split()
(n, k) = (int(n), int(k))
print(min(int((-1 + math.sqrt(385 - 1.6 * k)) / 2), n))


(p, t) = map(int, input().split())
i = j = 0
tl = 240 - t
for x in range(p + 1):
	j = j + x * 5
	if j > tl:
		break
	else:
		i = x
print(i)


(a, b) = map(int, input().split())
time = 240 - b
k = 0
cout = 0
for i in range(1, a + 1):
	k += 5 * i
	if k > time:
		break
	cout += 1
print(cout)


N = list(map(int, input().split()))
TIME = 240 - N[1]
C = 0
for _ in range(N[0]):
	TIME -= 5 * (_ + 1)
	if TIME >= 0:
		C += 1
	else:
		break
print(C)


(n, k) = map(int, input().split(' '))
foo = 240 - k
t = 0
count = 0
for i in range(1, n + 1):
	t += i * 5
	if t > foo:
		print(i - 1)
		break
if t <= foo:
	print(n)


(n, m) = map(int, input().split())
m = 240 - m
so = 0
j = 0
for i in range(1, n + 1):
	j = i
	so += i * 5
	if so > m:
		j -= 1
		break
print(j)


(n, k) = map(int, input().split())
competition = 0
questions = 0
while competition + k <= 240 and questions <= n:
	questions += 1
	competition += 5 * questions
print(questions - 1)


(n, m) = map(int, input().split())
s = 0
a = []
i = 1
l = 240 - m
while s <= l:
	s = s + 5 * i
	a.append(s)
	i = i + 1
k = 0
i = 0
while i < len(a) - 1:
	if l >= a[i] and a[i] < 240:
		k = k + 1
	else:
		break
	i = i + 1
if k > n:
	print(n)
else:
	print(k)


(n, m) = [int(i) for i in input().split()]
rem = 240 - m
if rem > 0:
	i = 1
	while rem - 5 * i >= 0:
		rem -= 5 * i
		i += 1
	if i > n:
		print(n)
	else:
		print(i - 1)
else:
	print(0)


a = input().split()
n = int(a[0])
k = 240 - int(a[1])
l = []
f = True
for i in range(n + 1):
	l.append(5 * i * (i + 1) // 2)
	if l[i] > k:
		print(i - 1)
		f = False
		break
	elif l[i] == k:
		print(i)
		f = False
		break
if f:
	print(n)


numbers = [int(x) for x in input().split(' ')]
limaks_spare_time = 240 - numbers[1]
solving_time = 0
for i in range(1, numbers[0] + 1):
	solving_time += 5 * i
	if solving_time > limaks_spare_time:
		print(i - 1)
		break
if solving_time <= limaks_spare_time:
	print(numbers[0])


(n, k) = map(int, input().split())
s = k
count = 0
while s <= 240 and count <= n:
	count += 1
	s += 5 * count
print(count - 1)


(n, k) = [int(x) for x in input().split()]
count = 0
i = 1
min_left = 240 - k
while min_left > 0 and i <= n:
	min_left -= 5 * i
	if min_left < 0:
		break
	count += 1
	i += 1
print(count)


from math import floor, sqrt
(a, b) = map(int, input().split())
c = (240 - b) * 2
dc = sqrt(25 + 4 * 5 * c)
e = (-5 + dc) // (2 * 5)
e = floor(e)
if e > a:
	print(a)
else:
	print(e)


(n, k) = map(int, input().split())
print(sum([i * (i + 1) * 5 / 2 <= 240 - k for i in range(1, n + 1)]))


m = 240
(n, k) = map(int, input().split())
s = m - k
c = 0
i = 1
while 1:
	s -= 5 * i
	if s >= 0 and i < n + 1:
		i += 1
	else:
		break
print(i - 1)


(a, b) = map(int, input().split())
b = 240 - b
s = 0
while s < a:
	if b - (s + 1) * 5 < 0:
		break
	else:
		s = s + 1
		b = b - s * 5
print(s)


(n, k) = map(int, input().split())
minsleft = 240 - k
res = 0
prob = 0
while res <= minsleft:
	prob += 1
	res += 5 * prob
if minsleft < 5:
	print(0)
else:
	print(min(n, prob - 1))


import math
[n, k] = [int(x) for x in input().split()]
t = 240 - k
ans = math.floor((math.sqrt(25 + 40 * t) - 5) / 10)
ans = min(ans, n)
print(ans)


import sys
(n, k) = input().strip().split()
(n, k) = (int(n), int(k))
k = 240 - k
i = 0
for i in range(1, n + 1):
	k = k - i * 5
	if k < 0:
		print(i - 1)
		break
if i == n and k >= 0:
	print(n)


(n, m) = map(int, input().split())
q = 240 - m
i = 1
while n > 0 and q >= 5 * i:
	q -= 5 * i
	i += 1
	n -= 1
print(i - 1)


(n, k) = map(int, input().split())
col = 4 * 60 - k
cnt = 0
for i in range(1, n + 1):
	col -= i * 5
	if col < 0:
		break
	cnt += 1
print(cnt)


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
(n, k) = minput()
t = 240 - k
for i in range(n, -1, -1):
	if 5 * (i * (i + 1) // 2) <= t:
		print(i)
		break


l = list(map(int, input().split()))
cnt = 0
s = 0
for i in range(1, l[0] + 1):
	s += i * 5
	if s + l[1] <= 240:
		cnt += 1
	else:
		break
print(cnt)


(problems, distance) = input().split()
time = 240
probtime = time - int(distance)
j = 0
i = 0
while j < probtime and i < int(problems):
	i += 1
	j = j + i * 5
if j > probtime:
	print(i - 1)
else:
	print(i)


N = input()
S = N.split(' ')
Na = 240 - int(S[1])
p = int(S[0])
suma = 0
if Na < 0 or Na == 0:
	print(0)
else:
	suma = 0
	k = 0
	while suma < Na and k < p:
		k += 1
		suma = suma + k * 5
	if k == p and suma < Na:
		print(p)
	elif suma == Na:
		print(k)
	else:
		print(k - 1)


(n, k) = map(int, input().split())
t = 240
l = []
for i in range(1, n + 1):
	l.append(i * 5)
x = 0
count = 0
for i in l:
	t = t - i
	if t < k:
		break
	else:
		count += 1
print(count)


import math
(t, s) = [int(x) for x in input().split()]
cnt = 0
sum = 240 - s
for i in range(1, t + 1):
	sum = sum - i * 5
	if sum <= 0:
		break
if sum < 0:
	print(i - 1)
else:
	print(i)


s = input().split()
n = int(s[0])
k = int(s[1])
t = 240 - k
cnt = 0
while True:
	t -= (cnt + 1) * 5
	if t < 0 or cnt + 1 > n:
		break
	cnt += 1
print(cnt)


a = list(map(int, input().split()))
r = 240 - a[1]
c = 0
for i in range(1, a[0] + 1):
	if r - 5 * i >= 0:
		r = r - 5 * i
		c = c + 1
print(c)


(n, k) = map(int, input().split())
ans = n
for i in range(n):
	k += (i + 1) * 5
	if k > 240:
		ans = i
		break
print(ans)


(n, k) = map(int, input().split())
t = 240 - k
(l, r) = (0, n)
for i in range(300):
	mid = (l + r) // 2
	if 5 * mid * (mid + 1) // 2 <= t:
		l = mid
	else:
		r = mid - 1
while l <= r:
	if 5 * r * (r + 1) // 2 <= t:
		print(r)
		break
	r -= 1


(a, b) = map(int, input().split())
all_time = 240 - b
count = 0
for i in range(1, a + 1):
	if all_time - i * 5 < 0:
		break
	else:
		all_time -= i * 5
		count += 1
print(count)


l = list(map(int, input().split(' ')))
n = l[0]
time = l[1]
k = 240 - time
m = 0
total = 0
for i in range(1, n + 1):
	total = total + 5 * i
	if total <= k:
		m = i
	else:
		break
print(m)


(n, k) = input().split()
n = int(n)
k = int(k)
t = 240 - k
co = 0
t1 = 0
for i in range(1, n + 1):
	t1 += 5 * i
	if t1 <= t:
		co += 1
	else:
		break
print(co)


(n, k) = map(int, input().split())
max_possible = 240 - k
arr = []
total = 0
c = 0
for i in range(1, n + 1):
	arr.append(5 * i)
for i in arr:
	total += i
	if total <= max_possible:
		c += 1
print(c)


(a, b) = list(map(int, input().split()))
totalTime = 240
arr = [5 * x for x in range(1, a + 1)]
prefix = [arr[0]]
for x in range(1, len(arr)):
	prefix.append(arr[x] + prefix[x - 1])
ans = 0
totalTime = totalTime - b
for x in prefix:
	if x <= totalTime:
		ans += 1
print(ans)


(n, k) = map(int, input().split())
res = 4 * 60 - k
i = 1
while True:
	if 5 * i > res:
		break
	if i == n:
		i += 1
		break
	res -= 5 * i
	i += 1
print(i - 1)


(n, k) = list(map(int, input().split(' ')))
m = [i for i in range(5, 51, 5)]
total = 240 - k
output = 0
for i in range(0, n):
	if total >= m[i]:
		total -= m[i]
		output += 1
print(output)


(n, k) = map(int, input().split())
A = [0]
for i in range(1, n + 1):
	A.append(A[i - 1] + 5 * i)
A = A[1:]
l = 0
r = n
lol = 240 - k
while r - l > 1:
	mid = (l + r) // 2
	if A[mid] <= lol:
		l = mid
	elif A[mid] > lol:
		r = mid
	else:
		break
if lol < A[0]:
	print(0)
else:
	print(l + 1)


(a, b) = map(int, input().split())
c = 4 * 60 - b
count = 0
d = 0
for i in range(1, a + 1):
	d = d + 5 * i
	if d <= c:
		count += 1
	else:
		break
print(count)


(n, k) = list(map(int, input().split()))
s = 0
end = 4 * 60 - k
for i in range(1, n + 1):
	s += i * 5
	if s > end:
		i -= 1
		break
print(i)


(n, k) = [int(x) for x in input().split()]
time = 240 - k
total = 0
c = 0
for i in range(1, n + 1):
	if total + 5 * i <= time:
		total += 5 * i
		c += 1
	else:
		break
print(c)


(n, k) = [int(x) for x in input().split()]
count = 0
limit = 0
for i in range(1, n + 1):
	if limit + 5 * i <= 240 - k:
		limit += 5 * i
		count += 1
	else:
		break
print(count)


time_used = 0
(n, k) = [int(i) for i in input().split()]
time_left = 4 * 60 - k
i = 0
while time_used + 5 * (i + 1) <= time_left and i < n:
	i += 1
	time_used += 5 * i
print(i)


from sys import stdin

def find(prob, n, k):
	for i in range(n):
		t = prob[i] + k
		if t > 240:
			return i
	return n

def main():
	prob = [5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
	(n, k) = [int(x) for x in stdin.readline().strip().split()]
	print(find(prob, n, k))
main()


f = lambda : map(int, input().split())
(n, k) = f()
t = 0
for i in range(1, n + 1):
	t += i * 5
	if t > 240 - k:
		break
print(i - 1 if t > 240 - k else i)


(n, k) = map(int, input().split())
time = 240 - k
i = 0
while time >= 0:
	i += 1
	time -= i * 5
print(min(i - 1, n))


(num_prb, mins) = map(int, input().split())
time = 0
i = 1
while time <= 240 - mins:
	time += 5 * i
	i += 1
if i - 2 > num_prb:
	print(num_prb)
else:
	print(i - 2)


(n, k) = map(int, input().split(' '))
remaining_time = 240 - k
problem_time = [5 * (i + 1) for i in range(0, n)]
if remaining_time == 0:
	print(0)
else:
	count = 0
	for i in problem_time:
		if remaining_time - i < 0:
			break
		remaining_time -= i
		count += 1
	print(count)


(n, m) = list(map(int, input().split(' ')))
reserve = int(240) - m
count = int(0)
for i in range(1, n + 1):
	spend = int(5) * i
	if reserve < spend:
		break
	else:
		reserve -= spend
		count += 1
print(count)


__author__ = 'Clown'
import re
import os
re_inputSplit = re.compile('\\s+')

def solve(T, N, K):
	T -= K
	ans = 0
	for i in range(1, N + 1):
		if T < i * 5:
			break
		T -= 5 * i
		ans += 1
	return ans

def main():
	T = 240
	variables = re_inputSplit.split(input())
	N = int(variables[0])
	K = int(variables[1])
	print(solve(T, N, K))
main()


from sys import stdin
from math import sqrt
(n, k) = [int(i) for i in stdin.readline().split(' ')]
solvingTime = 240 - k
ans = min(int(sqrt(solvingTime * 2 // 5)), n)
if ans * (ans + 1) * 5 // 2 > solvingTime:
	ans -= 1
print(ans)


x = [int(i) for i in input().split()]
(n, k) = (x[0], x[1])
remain = 240 - k
for i in range(1, 11):
	if i * (i + 1) / 2 * 5 > remain:
		print(min(n, i - 1))
		break


(n, k) = list(map(int, input().split()))
tl = 240 - k
if 5 * (n * (n + 1) / 2) < tl:
	print(n)
for item in range(0, n + 1):
	if 5 * (item * (item + 1) / 2) == tl:
		print(item)
	elif 5 * (n * (n + 1) / 2) > tl and 5 * (item * (item + 1) / 2) < tl and (5 * (item + 1) * (item + 2) // 2 > tl):
		print(item)


import math
(n, k) = list(map(int, input().split()))
c = int((math.sqrt(1 + 8 * (240 - k) / 5) - 1) / 2)
if c > n:
	print(n)
else:
	print(c)


inp = input().split()
n = int(inp[0])
k = int(inp[1])
time = 0
sp = 0
le = 240 - k
for i in range(1, n + 1):
	if le >= 5 * i:
		sp = i
		time = 5 * i
		le = le - time
	else:
		break
print(sp)


(n, k) = map(int, input().split())
total = 4 * 60 - k
ans = 0
for i in range(1, n + 1):
	if total - i * 5 >= 0:
		total -= i * 5
		ans += 1
	else:
		break
print(ans)


(q, w) = map(int, input().split())
w = 240 - w
i = 0
while w >= 5 * (i + 1):
	i += 1
	w -= 5 * i
print(min(i, q))


from sys import stdin, stdout
rin = stdin.readline
out = stdout.write
(N, K) = map(int, rin().split())
m = 0
i = 1
while i <= N:
	m += i * 5
	if m > 240 - K:
		break
	i += 1
out(str(i - 1) + '\n')


(n, k) = map(int, input().split())
i = 2
amt = 0
s = [5]
while sum(s) + k <= 240 and n != 0:
	s.append(5 * i)
	n -= 1
	i += 1
	amt += 1
print(amt)


(n, k) = map(int, input().split(' '))
minnico = 0
for i in range(1, n + 1):
	minnico += i * 5
	if minnico > 240 - k:
		y = i - 1
		print(y)
		exit()
print(i)


(n, k) = [int(x) for x in input().split(' ')]
left = 240 - k
i = 0
while True:
	left -= 5 * (i + 1)
	if left < 0:
		break
	i += 1
print(str(min(i, n)))


(n, k) = map(int, input().split())
(tasks, max_time) = (0, 240 - k)
while 5 * tasks * (tasks + 1) <= 2 * max_time:
	tasks += 1
print(min(n, tasks - 1))


(n, k) = map(int, input().split())
d = 240 - k
data = [5]
for i in range(1, n):
	data.append(data[i - 1] + (i + 1) * 5)
print(len(list(filter(lambda i: i <= d, data))))


def tem(v):
	n = 0
	c = 5
	for i in range(0, v):
		n += c
		c += 5
	return n
(l, m) = input().split()
(l, m) = (int(l), int(m))
r = l
if m > 235:
	r = 0
else:
	for i in range(0, l):
		d = tem(r)
		if d + m > 240:
			r -= 1
print(r)


(n, k) = map(int, input().split())
total = 4 * 60
k = total - k
tmp = n
c = 1
while tmp > 0 and k > 0:
	k -= c * 5
	if k < 0:
		break
	tmp -= 1
	c += 1
if tmp > 0:
	print(n - tmp)
else:
	print(n)


(problems, times) = map(int, input().split())
lefttime = 240 - int(times)
needtimes = 0
for i in range(problems):
	needtimes += (i + 1) * 5
	if needtimes > lefttime:
		print(i)
		break
	elif needtimes == lefttime:
		print(i + 1)
		break
	elif i + 1 == problems and needtimes <= lefttime:
		print(problems)
		break


data = input()
lst = list()
for i in data.split():
	lst.append(int(i))
n = lst[0]
k = lst[1]
rem = 240 - k
i = 1
time = 0
while i <= n:
	time = time + 5 * i
	if time > rem:
		break
	elif time == rem:
		i = i
	i = i + 1
print(i - 1)


tot = count = 0
(n, k) = list(map(int, input().split()))
if k == 240:
	print(0)
else:
	for i in range(1, n + 1):
		tot += 5 * i
	tot = tot + k
	for i in reversed(range(1, n + 1)):
		h = 20
		m = 0
		h += tot // 60
		m += tot % 60
		if h < 24 and m <= 60:
			count += 1
		elif h == 24 and m == 0:
			count += 1
		tot = tot - 5 * i
	print(count)


import sys
parametrs = list(map(int, input().split()))
count = parametrs[0]
distance_minitues = parametrs[1]
time_for_task = 240 - distance_minitues
solutions_task = 0
i = 0
while time_for_task >= 5 * (i + 1):
	solutions_task += 1
	i += 1
	time_for_task -= 5 * i
	if solutions_task >= count:
		solutions_task = count
		break
print(solutions_task)


(n, k) = map(int, input().split())
t = 240 - k

def gg(x):
	k = 0
	for i in range(1, x + 1):
		k += i * 5
	return k
l = -1
r = n + 1
while l + 1 < r:
	m = (l + r) // 2
	if gg(m) > t:
		r = m
	else:
		l = m
print(l)


(n, k) = map(int, input().split())
sum = 5 * n * (n + 1) // 2
a = 240 - k
i = n
while a < sum:
	sum -= 5 * i
	i -= 1
print(i)


(problems, minutes) = map(int, input().split())
solved = 0
taken = 0
time = 240 - minutes
for i in range(1, problems + 1):
	taken += i * 5
	if taken > time:
		break
	else:
		solved += 1
print(solved)


def main():
	(n, k) = map(int, input().split())
	timeL = 60 * 4 - k
	prob = 0
	min = 0
	while min + prob * 5 <= timeL:
		min += prob * 5
		prob += 1
	if prob > n:
		print(n)
	else:
		print(prob - 1)
main()


(n, k) = map(int, input().split())
m = 60 * 4 - k
i = 1
while i * 5 <= m:
	m -= i * 5
	i += 1
print(min(i - 1, n))


(n, k) = list(map(int, input().split()))
timeLeft = 240 - k
timeConsumed = 5
problemNumber = 2
numberOfProblemsSolved = 0
while timeConsumed <= timeLeft and n >= 1:
	timeConsumed += 5 * problemNumber
	problemNumber += 1
	n -= 1
	numberOfProblemsSolved += 1
print(numberOfProblemsSolved)


(a, b) = map(int, input().split())
x = int(1)
while b + 5 * x <= 240:
	b = b + 5 * x
	x = x + 1
print(min(x - 1, a))


(n, k) = map(int, input().split())
h = 4 * 60 - k
ans = 0
i = 1
while h >= 0 and i <= n:
	h -= i * 5
	if h >= 0:
		ans += 1
	i += 1
print(ans)


(n, t) = map(int, input().split())
rt = 240 - t
s = 0
for x in range(1, n + 1):
	s = s + 5 * x
	if s > rt:
		print(x - 1)
		break
else:
	print(n)


time = 240
[n, k] = [int(x) for x in input().split()]
time -= k
problems = 0
i = 1
while time - 5 * i >= 0:
	problems += 1
	time -= 5 * i
	i += 1
	if problems == n:
		break
print(problems)


(n, minute) = map(int, input().split())
s1 = 240 - minute
s = 0
count = 0
while count < n and s1 - s >= (count + 1) * 5:
	count = count + 1
	s = s + count * 5
print(count)


def main():
	(n, k) = input().split(' ')
	t = 240 - int(k)
	mins = []
	c = 0
	for i in range(1, int(n) + 1):
		mins.append(i * 5)
	for min in mins:
		if t - min >= 0:
			t -= min
			c += 1
		else:
			break
	print(c)
main()


(n, m) = list(map(int, input().split()))
a = 240 - m
p = []
k = []
count = 0
c = 0
for i in range(1, n + 1):
	p.append(5 * i)
for j in range(len(p)):
	c += p[j]
	k.append(c)
for x in range(len(k)):
	if k[x] <= a:
		count += 1
print(count)


l = list(map(int, input().split()))
lefttime = 240 - l[1]
i = 1
c = 0
while i <= l[0] and lefttime >= 5 * i:
	lefttime -= 5 * i
	c += 1
	i += 1
print(c)


(q, w) = map(int, input().split())
r = 240 - w
n = 1
t = 0
while q != t and r >= n * 5:
	r = r - 5 * n
	t = t + 1
	n = n + 1
print(t)


(a, b) = map(int, input().split())
h = 240
v = 0
if b < h:
	v = b
	for i in range(1, a + 1):
		v = v + 5 * i
		if v > h:
			print(i - 1)
			break
	else:
		print(i)
else:
	print('0')


from bisect import bisect
isDebug = False
(n, k) = [int(i) for i in input().split()]
d = 240 - k
a = [5 * i for i in range(1, n + 1)]
print(f'd={d}, a={a}') if isDebug else ''
a1 = []
a1.append(a[0])
for i in range(1, len(a)):
	a1.append(a1[i - 1] + a[i])
print(f'a1={a1}') if isDebug else ''
b = bisect(a1, d)
print(f'{b}')


(n, k) = map(int, input().split())
temp = 240
timeleft = temp - k
if timeleft == 0:
	print(0)
else:
	(k, res, i) = (0, 0, 1)
	while k <= timeleft and res <= n:
		k += i * 5
		i += 1
		res += 1
	print(res - 1)


(n, k) = list(map(int, input().split()))
ost_t = 240 - k
time = 0
i = 1
while ost_t >= time:
	time += i * 5
	i += 1
print(min(i - 2, n))


(n, k) = map(int, input().split())
l = [i * 5 for i in range(1, n + 1)]
x = 0
i = 0
for i in range(len(l)):
	x = k + sum(l)
	if x <= 240:
		print(n)
		break
	else:
		l.pop(-1)
		n -= 1
if k > 235:
	print(0)


n_k = [int(i) for i in input().split()]
problems = n_k[0]
if n_k[1] >= 236:
	print('0')
else:
	while problems:
		if 5 * problems * (problems + 1) / 2 + n_k[1] <= 240:
			print(problems)
			break
		else:
			problems -= 1


nkStr = input()
n = int(nkStr.split()[0])
k = int(nkStr.split()[1])
timeForSolve = 240 - k
i = 0
while i <= n:
	if timeForSolve < i * (i + 1) // 2 * 5:
		break
	i = i + 1
print(i - 1)


(n, k) = map(int, input().split(' '))
sum = k
c = 0
f = 0
for i in range(1, n + 1):
	sum += 5 * i
	if sum > 240:
		print(c)
		f = 1
		break
	c += 1
if f == 0:
	print(c)


(n, k) = map(int, input().split())
t = 240 - k
i = 1
r = 0
while True:
	if t - i * 5 >= 0:
		t -= i * 5
		i += 1
		r += 1
	else:
		break
print(min(r, n))


(n, k) = [int(x) for x in input().split()]
timeForContest = 240 - k
problemTime = problemSumTime = problemNumber = 0
while problemSumTime < timeForContest:
	problemNumber += 1
	problemTime = 5 * problemNumber
	problemSumTime += problemTime
if problemSumTime > timeForContest:
	timeForContest -= problemTime
	problemNumber -= 1
print(problemNumber if problemNumber < n else n)


a = list(map(int, input().split()))
y = 240 - a[1]
sum = 0
count = 0
for i in range(1, a[0] + 1):
	if sum + 5 * i <= y:
		sum = sum + 5 * i
		count = count + 1
print(count)


a = list(map(int, input().split()))
(b, c, count, i) = (240 - a[1], 5, 0, 1)
while b >= c and count <= a[0] and (i <= a[0]):
	count = count + 1
	b = b - c
	i += 1
	c = i * 5
print(count)


(n, k) = input().split()
(n, k) = (int(n), int(k))
t = 240 - k
tot = 0
for i in range(n):
	tot += 5 * (i + 1)
	if tot > t:
		i -= 1
		break
i += 1
print(i)


given = list(map(int, input().split(' ')))
problems = 0
n = given[0]
k = given[1]
sum = 0
for i in range(1, n + 1):
	sum = sum + 5 * i
	if sum > 240 - k:
		break
	problems = problems + 1
print(problems)


(n, k) = map(int, input().split())
k = 240 - k
k = k // 5

def nu(x):
	return x * (x + 1) // 2
if nu(n) <= k:
	print(n)
else:
	for i in range(n):
		if nu(i) <= k < nu(i + 1):
			print(i)


a = input().split()
n = int(a[0])
k = int(a[1])
tr = 240 - k
t = 0
x = 1
y = 0
while n > 0:
	t = t + x * 5
	if t > tr:
		break
	x = x + 1
	y = y + 1
	n = n - 1
print(y)


(n, k) = [int(x) for x in input().split()]
k = 60 * 4 - k
for i in range(n):
	if k - 5 * (i + 1) >= 0 and i + 1 <= n:
		k = k - 5 * (i + 1)
	else:
		print(i)
		break
else:
	print(i + 1)


def binary_search(lst, timeleft):
	left = 0
	right = len(lst) - 1
	while left <= right:
		mid = (left + right) // 2
		if lst[mid] > timeleft:
			right = mid - 1
		else:
			left = mid + 1
	return right + 1
(n, k) = map(int, input().split())
lst = []
_sum = 0
for i in range(n):
	_sum += 5 * (i + 1)
	lst.append(_sum)
timeleft = 240 - k
print(binary_search(lst, timeleft))


(n, k) = map(int, input().split())
time_solve = 240 - k

def can_solve(i, time_solve):
	if 5 * i * (i + 1) // 2 <= time_solve:
		return True
	return False
l = -1
r = n + 1
while r > l + 1:
	mid = (r + l) // 2
	if can_solve(mid, time_solve):
		l = mid
	else:
		r = mid
print(l)


limak_input = [int(s) for s in input().split(' ')]
problems_counter = 0
problems = [i * 5 for i in range(1, limak_input[0] + 1)]
for i in range(limak_input[0]):
	if sum(problems[0:i + 1]) + limak_input[1] <= 240:
		problems_counter += 1
print(problems_counter)


(n, k) = [int(x) for x in input().split()]
a = 0
for i in range(1, n + 1):
	if 2.5 * i * (i + 1) > 240 - k:
		a = 1
		break
if a:
	print(i - 1)
else:
	print(i)


(number_of_problems, travel_time) = [int(i) for i in input().split()]
count = 240
time_to_solve = 0
problems_solved = 0
for i in range(number_of_problems):
	time_to_solve += 5 * (i + 1)
	if time_to_solve + travel_time <= count:
		problems_solved += 1
	else:
		break
print(problems_solved)


import math

class Input:

	def readInt(self):
		return int(input())

	def readIntArray(self):
		return [int(x) for x in input().split(' ')]

	def readString(self):
		return input()

	def readStringArray(self):
		return input().split(' ')

	def readFloat(self):
		return float(input())

	def readFloatArray(self):
		return [float(x) for x in input().split(' ')]

def main():
	inp = Input()
	(n, k) = inp.readIntArray()
	sump = 0
	for i in range(1, n + 1):
		sump += 5 * i
		if sump > 240 - k:
			print(i - 1)
			return
	print(n)
main()


import math
a = list(map(int, input().split()))
print(min(a[0], int((math.sqrt(384 - 1.6 * a[1] + 1) - 1) / 2)))


(n, k) = [int(x) for x in input().split()]
time = 240 - k
count = 0
solved = 0
i = 1
while solved <= time and i <= n:
	solved += 5 * i
	if solved <= time:
		count += 1
	i += 1
print(count)


(n, k) = (int(i) for i in input().split())
from math import sqrt
i = (sqrt(1 + (1920 - 8 * k) / 5) - 1) / 2
if n > i:
	print(int(i))
else:
	print(n)


l = [int(x) for x in input().split(' ')]
n = l[0]
k = l[1]
tm = 240 - k
sum1 = tm
i = 1
count = 0
while tm - i * 5 >= 0 and count < n:
	tm = tm - i * 5
	i = i + 1
	count = count + 1
print(count)


x = input().split()
n = int(x[0])
k = int(x[1])
t = 240 - k
c = 0
y = 0
for i in range(1, n + 1):
	i *= 5
	c += i
	if c > t:
		break
	y += 1
print(y)


(n, k) = map(int, input().split())
t_total = 240 - k
t = 0
p = 0
for i in range(1, n + 1):
	t = t + 5 * i
	if t > t_total:
		i = i - 1
		break
print(i)


(n, k) = map(int, input().split())
r = 240 - k
howmany = 0
for i in range(n, -1, -1):
	t = 5 * i * (i + 1) / 2
	if r >= t:
		howmany = i
		break
print(howmany)


(p, q) = [int(i) for i in input().split()]
q = 240 - q
print(min((p, int((1 + 1.6 * q) ** 0.5 - 1) // 2)))


from sys import stdin
(n, k) = map(int, stdin.readline().split())
minutes = 60 * 4 - k
i = 1
while minutes >= 0 and n >= i:
	minutes -= 5 * i
	i += 1
if minutes >= 0:
	print(n)
else:
	print(i - 2)


(n, k) = map(int, input().split())
a = 240 - k
i = 1
while 5 * (i * (i + 1)) // 2 <= a:
	i = i + 1
if i - 1 >= n:
	print(n)
else:
	print(i - 1)


(n, k) = list(map(int, input().split()))
ans = [5 * (i + 1) for i in range(10)]
rem = 240 - k
r = 0
for i in range(n):
	if rem >= ans[i]:
		r += 1
		rem -= ans[i]
print(r)


(n, k) = map(int, input().split())
t = 240 - k
ans = 0
for i in range(n):
	r = 5 * (i + 1)
	print
	if r <= t:
		ans += 1
		t -= r
print(ans)


class party:
	n = 0
	k = 0
	lh = 0

	def __init__(self, nk):
		(self.n, self.k) = nk.split(' ')
		self.n = int(self.n)
		self.k = int(self.k)
		self.calc()

	def calc(self):
		self.lh = 240 - self.k
		ls = []
		req = 1
		for i in range(1, self.n + 1):
			req = 5 * i
			ls.append(req)
		su = 0
		count = 0
		for i in range(len(ls)):
			su += ls[i]
			if su <= self.lh:
				count += 1
			else:
				break
		print(count)

def Main():
	nk = input('')
	limik = party(nk)
Main()


import math
(n, k) = map(int, input().split())
total = k
i = 1
while True:
	total += i * 5
	if total > 240 or i > n:
		i -= 1
		break
	i += 1
print(i)


(n, k) = map(int, input().split())
cnt = 0
t = 240 - k
x = 5
i = 1
l = [5]
while t >= sum(l) and i <= n:
	cnt = cnt + 1
	i = 1 + i
	l.append(5 * i)
print(cnt)


(n, k) = map(eval, input().split())
t = 240 - k
i = 1
while i <= n:
	t -= 5 * i
	if t < 0:
		i -= 1
		break
	i += 1
if i >= n:
	print(n)
else:
	print(i)


(n, k) = list(map(int, input().split()))
can = 240 - k
for i in range(1, 500):
	can -= i * 5
	if can < 0 or i == n + 1:
		print(i - 1)
		exit(0)


(n, k) = [int(s) for s in input().split()]
(t, z) = (0, 0)
while t <= 240 - k - 5 * (z + 1) and z < n:
	z += 1
	t += 5 * z
print(z)


(n, k) = map(int, input().split())
count = 1
sum = k
while sum <= 240 and count <= n:
	sum += count * 5
	if sum <= 240:
		count += 1
print(count - 1)


a = [int(a) for a in input().split()]
c = 0
r = 1
while r <= a[0]:
	c = c + 5 * r
	if c + a[1] > 240:
		break
	r = r + 1
print(r - 1)


from math import floor, sqrt
(n, k) = map(int, input().strip().split())
time = 240 - k
c = -floor((240 - k) * 2 / 5)
print(min(n, floor(max((-1 + sqrt(1 - 4 * c)) / 2, (-1 - sqrt(1 - 4 * c)) / 2))))


(a, b) = map(int, input().split())
b = 240 - b
count = 0
while a > 0 and b >= (count + 1) * 5:
	count += 1
	a -= 1
	b -= count * 5
print(count)


(n, k) = input().split()
n = int(n)
k = int(k)
k = 240 - k
i = 0
while k >= 0:
	i += 1
	k -= 5 * i
i -= 1
if i > n:
	print(n)
else:
	print(i)


(n, k) = map(int, input().split(' '))
sum1 = k
for i in range(1, n + 1):
	sum1 += 5 * i
	if sum1 > 240:
		print(i - 1)
		break
	elif i == n:
		print(n)


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]))
(n, k) = mp()
t = 0
i = 1
while i <= n and t + 5 * i <= 240 - k:
	t += 5 * i
	i += 1
pt(i - 1)


(n, k) = [int(word) for word in input().split()]
t = 240 - k
count = 0
for i in range(1, n + 1):
	cost = 5 * i
	if t >= cost:
		t -= cost
		count += 1
print(count)


(n, k) = [int(i) for i in input().split()]
var = 240 - k
ans = 0
i = 1
while var >= 5 * i:
	var -= 5 * i
	ans += 1
	if i == n:
		break
	i += 1
print(ans)


time = 4 * 60
(n, k) = [int(_) for _ in input().split()]
time -= k
for i in range(1, n + 2):
	time -= 5 * i
	if time < 0:
		break
print(i - 1)


from collections import defaultdict
import math

def calculate(N, K):
	return 5 * (N / 2 * (N + 1)) + K
(N, K) = map(int, input().split())
while N >= 0:
	if calculate(N, K) <= 240:
		ans = N
		break
	N = N - 1
print(ans)


b = input().split(' ')
b[0] = int(b[0])
b[1] = int(b[1])
b[1] = 240 - b[1]
m = 0
j = 0
while j < b[0]:
	m = m + 1
	if str(b[1] - (5 * (j + 1) + j * 5))[0] == '-' or str(b[1] - (5 * (j + 1) + j * 5))[0] == '0':
		j = j + b[0]
	j = j + 1
	b[1] = b[1] - 5 * m
	if str(b[1])[0] == '-':
		m = m - 1
print(m)


(a, b) = map(int, input().split())
c = 240 - b
i = 5
x = 0
while c - i >= 0 and x < a:
	c -= i
	i += 5
	x += 1
print(x)


(a, b) = map(int, input().split())
count = 0
i = 1
while i <= a:
	c = i * 5
	b = b + c
	i = i + 1
	if b <= 240:
		count += 1
print(count)


(n, k) = map(int, input().split())
time = 240 - k
ans = 0
i = 0
j = 5
while i <= time:
	i += j
	j += 5
	if i <= time:
		ans += 1
print(min(ans, n))


(n, wkt) = [int(x) for x in input().split()]
le = 0
ri = n
wkt = 240 - wkt
while le <= ri:
	mi = (le + ri) // 2
	su = (1 + mi) * mi // 2
	if su * 5 <= wkt:
		le = mi + 1
		ans = mi
	else:
		ri = mi - 1
print(ans)


inp = input().split()
inp[0] = int(inp[0])
inp[1] = int(inp[1])
arr = [5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
mins = 240 - inp[1]
i = 0
while arr[i] <= mins:
	i += 1
print(min(i, inp[0]))


(n, k) = map(int, input().split())
t = 240
c = 0
i = 1
t_end = t - k
while i <= n:
	t_end -= 5 * i
	i += 1
	if t_end >= 0:
		c += 1
print(c)


(n, k) = map(int, input().split())
dl = 240
t = k
i = 1
while t + i * 5 <= dl and i <= n:
	t += i * 5
	i += 1
print(i - 1)


(n, k) = map(int, input().strip().split())
ans = 0
for i in range(n + 1):
	if i * (i + 1) // 2 * 5 + k <= 240:
		ans = i
print(ans)


import sys

def Main(n, k):
	mn = 240
	sm = 0
	res = mn - k
	cnt = 0
	for i in range(1, n + 1):
		sm += 5 * i
		if sm > res:
			break
		else:
			cnt += 1
	print(cnt)
(n, k) = map(int, input().split())
Main(n, k)


(n, k) = map(int, input().split())
target = 240 - k
res = 0
s = 0
for i in range(1, n + 1):
	s += 5 * i
	if s <= target:
		res += 1
	else:
		break
print(res)


(n, m) = map(int, input().split())
time = 0
so = 0
for i in range(1, n + 2, 1):
	time += i * 5
	if time + m > 240 or i == n + 1:
		print(so)
		quit()
	so = i


(m, n) = map(int, input().split())
p = m
c = 0
i = 1
k = 240 - n
while k - i * 5 >= 0 and m > 0:
	m -= 1
	c += 1
	k -= i * 5
	i += 1
print(c)


def tottime(n, k):
	tot = 0
	for i in range(n):
		tot = tot + (i + 1) * 5
	tot = tot + k
	return tot
(n, k) = map(int, input().split(' '))
total1 = tottime(n, k)
if total1 <= 240:
	print(n)
else:
	while total1 > 240:
		n = n - 1
		total1 = tottime(n, k)
	print(n)


(n, k) = map(int, input().split())
four_hours = 240
time_ = four_hours - k
n_time = 0
j = 0
for i in range(1, n + 1):
	n_time = n_time + 5 * i
	if time_ >= n_time:
		j += 1
	else:
		break
print(j)


def diff(d, k):
	return 5 * d * (d + 1) // 2 < k

def binarySearch(left, right, search):
	mid = left + (right - left) // 2
	while True:
		if right - left == 1:
			if 5 * right * (right + 1) // 2 <= search:
				return right
			return left
		if diff(mid, search):
			left = mid
		else:
			right = mid
		mid = left + (right - left) // 2

def main():
	(n, k) = map(int, input().split())
	k = 240 - k
	print(min(binarySearch(0, n, k), n))
main()


(a, b) = input().split()
(a, b) = (int(a), int(b))
i = 1
s = 0
while s <= 240 - b:
	s += 5 * i
	i += 1
if i - 2 >= a:
	print(a)
else:
	print(i - 2)


tiempo = 240
(n, k) = map(int, input().split())
tiempo -= k
contador = 0
for i in range(n):
	if tiempo - 5 * (i + 1) >= 0:
		tiempo -= 5 * (i + 1)
		contador += 1
	else:
		break
print(contador)


(n, k) = input().split()
n = int(n)
k = int(k)
time = 240 - k
count = 0
calc = 0
for each in range(1, n + 1):
	calc += 5 * each
	if calc <= time:
		count += 1
print(count)


(a, b) = map(int, input().split())
t = 4 * 60 - b
ans = 0
i = 1
while ans < a and t - i * 5 >= 0:
	ans += 1
	t -= i * 5
	i += 1
print(ans)


def bs(a, x):
	l = 0
	r = len(a) - 1
	while r - l > 1:
		mid = int((l + r) / 2)
		if a[mid] < x:
			l = mid
		else:
			r = mid
	for i in range(l, r + 1):
		if a[i] > x:
			return i - 1
		if a[i] == x:
			return i
	return len(a) - 1
(n, k) = map(int, input().split())
a = list()
b = list()
b.append(0)
for i in range(1, n + 1):
	a.append(i * 5)
	b.append(b[i - 1] + i * 5)
print(bs(b, 240 - k))


(n, k) = map(int, input().split())
k = 240 - k
count = 0
for task in range(1, n + 1):
	k -= task * 5
	if k >= 0:
		count += 1
	else:
		break
print(count)


from sys import stdin
(n, k) = [int(x) for x in stdin.read().rstrip().split()]
time = 240 - k
task_index = 1
while time >= task_index * 5 and task_index <= n:
	time -= task_index * 5
	task_index += 1
print('{}\n'.format(task_index - 1))


(n, k) = [int(i) for i in input().split()]
time = 240 - k
hard = 5
counter = 0
while time >= hard:
	counter += 1
	time -= hard
	hard += 5
print(min(counter, n))


total_minutes = 60 * 4
(n, k) = map(int, input().split())
problem_minutes_left = total_minutes - k
i = list(range(1, n + 1))
counter = 0
for problem in i:
	if problem * 5 <= problem_minutes_left:
		counter += 1
		problem_minutes_left -= problem * 5
	else:
		break
print(counter)


(n, k) = input().split()
n = int(n)
k = int(k)
cnt = 0
for i in range(1, n + 1):
	if k + 5 * i <= 240:
		k += 5 * i
		cnt += 1
print(cnt)


(n, k) = [int(x) for x in input().strip().split(' ')]
T = 240
t = T - k
s = 0
tr = t
for i in range(1, n + 1):
	if 5 * i > tr:
		break
	tr -= 5 * i
	s += 1
print(s)


l = list(map(int, input().split()))
k = 5 * l[0]
s = 0
s1 = 0
for i in range(0, k + 1, 5):
	s = s + i
	if s + l[1] <= 240:
		s1 = s1 + 1
print(s1 - 1)


(a, b) = input().split()
a = int(a)
b = int(b)
s = 0
for i in range(1, a + 1):
	s += 5 * i
	if b + s > 240:
		print(i - 1)
		exit(0)
print(i)


(n, k) = input().split()
n = int(n)
k = int(k)
s = 0
f = 0
for i in range(1, n + 1):
	s += i * 5
	if s + k <= 240:
		f += 1
print(f)


txt = input().split(' ')
(n, k) = (int(txt[0]), int(txt[1]))
base = 0
while k <= 240 and base <= n:
	base += 1
	k += 5 * base
print(base - 1)


from sys import stdin

def sol(s1, s2):
	time_left = 240 - s2
	t = 0
	solved = 0
	i = 1
	while t + 5 * i <= time_left and solved != s1:
		t += 5 * i
		i += 1
		solved += 1
	return solved
(num1, num2) = map(int, stdin.readline().split())
print(sol(num1, num2))


(n, k) = map(int, input().split())
remaining_time = 240 - k
count = 0
index = 0
c = [(i + 1) * 5 for i in range(n)]
if sum(c) <= remaining_time:
	print(n)
else:
	for i in range(len(c)):
		if remaining_time - c[i] >= 0:
			remaining_time -= c[i]
			count += 1
		else:
			break
	print(count)


(n1, t1) = input().split()
n = int(n1)
t = int(t1)
r = 240 - t
i = 1
while r - 5 * i >= 0 and i <= n:
	r = r - 5 * i
	i = i + 1
print(i - 1)


nk = input().split()
n = int(nk[0])
k = int(nk[1])
ans = 0
for x in range(1, n + 1):
	ans += 1
	k += 5 * x
	if k > 240:
		ans -= 1
print(ans)


(n, k) = map(int, input().split())
rmtime = 240 - k
ans = 0
count = 1
while rmtime >= 0:
	ans += 1
	tmp = count
	while tmp > 0:
		rmtime -= 5
		tmp -= 1
	count += 1
if n > ans - 1:
	print(ans - 1)
else:
	print(n)


(n, k) = map(int, input().split())
p = 240 - k
c = 0
i = 1
while p >= 5 * i:
	p = p - 5 * i
	i += 1
	c += 1
	if c == n:
		break
print(c)


import math
(n, k) = map(int, input().split())
k = 240 - k
x = 2 * k / 5
d = 1 + 4 * x
a = (-1 + math.sqrt(d)) // 2
a = int(a)
if a >= n:
	print(n)
else:
	print(a)


(n, k) = input().split()
n = int(n)
k = int(k)
totaltime = 240 - k
j = 1
problems = 0
for i in range(n):
	time = 5 * j
	problems = problems + time
	j = j + 1
	if problems >= totaltime:
		break
if problems <= totaltime:
	print(j - 1)
else:
	print(j - 2)


(n, k) = list(map(int, input().split(' ')))
total_min = 240 - k
answer = 0
used = 0
l = 0
while used < total_min and l < n:
	l += 1
	used += 5 * l
if used <= total_min:
	answer = l
elif used > total_min:
	answer = l - 1
print(answer)


(n, k) = map(int, input().split())
t0 = 1200
t1 = 1440 - k
i = 0
while t0 <= t1 and i != n + 1:
	i += 1
	t0 += 5 * i
print(i - 1)


(n, k) = [int(x) for x in input().split()]
t = 240
t -= k
c = 0
while t >= 0:
	c += 1
	t -= c * 5
c -= 1
if c > n:
	c = n
print(c)


(n, m) = map(int, input().split())
k = 60 * 4
m = k - m
l = 0
while m >= 0 and l <= n:
	l += 1
	m -= l * 5
print(l - 1)


(n, k) = map(int, input().split())
rt = 240 - k
l = 0
for i in range(1, n + 1):
	l += i * 5
if l <= rt:
	print(n)
else:
	while n:
		if l <= rt:
			break
		l -= n * 5
		n -= 1
	print(n)


def totalTime(n):
	return int(n / 2 * (10 + (n - 1) * 5))
(n, k) = map(int, input().split())
time_left = 240 - k
problem_time = totalTime(n)
if 0 <= time_left <= 4:
	result = 0
elif problem_time <= time_left:
	result = n
else:
	for i in range(n - 1, -1, -1):
		time = totalTime(i)
		if time <= time_left:
			result = i
			break
print(result)


(n, k) = [int(i) for i in input().split()]
time = int(240)
flag = 0
waste = 0
count = 0
for i in range(1, n + 1):
	waste = waste + i * 5
	if waste + k <= time:
		count = count + 1
	else:
		break
print(count)


(n, t) = tuple(map(int, input().split()))
if t >= 240:
	exit(print(0))
q = 0
tot = 0
for i in range(1, n + 1):
	tot += i * 5
	if 240 - tot < t:
		exit(print(i - 1))
print(n)


(n, m) = map(int, input().split())
min = 240 - m
for i in range(1, n + 1):
	min = min - 5 * i
	if min >= 0:
		continue
	else:
		i = i - 1
		break
print(i)


(n, k) = input().split()
n = int(n)
k = int(k)
a = 240 - k
l = 0
count = 0
for i in range(1, n + 1):
	count += 5 * i
	if count <= a:
		l += 1
	else:
		break
print(l)


(n, k) = map(int, input().split())
s = 0
e = n + 1
avail = 240 - k
while True:
	m = (s + e) // 2
	req = m * (m + 1) * 5 / 2
	if req < avail:
		s = m
	elif req > avail:
		e = m
	elif req == avail:
		break
	mn = (s + e) // 2
	if mn == m:
		break
print(m)


line = input().split()
n = int(line[0])
k = int(line[1])
total = 0
num = 0
for i in range(1, n + 1):
	total += 5 * i
	num += 1
	if total + k > 240:
		total -= 5 * i
		num -= 1
print(str(num))


(n, k) = [int(i) for i in input().split()]
tot = k
cnt = 0
while tot < 240 and cnt < n:
	cnt += 1
	tot += 5 * cnt
	if tot > 240:
		print(cnt - 1)
		exit(0)
print(cnt)


f = lambda : map(int, input().split())
(n, k) = f()
solved = 0
time_left = 240 - k
time_spent = 0
while time_spent <= time_left and solved != n:
	solved += 1
	time_spent += 5 * solved
	if time_spent > time_left:
		solved -= 1
		break
print(solved)


(n, k) = map(int, input().split())
h = 240 - k
answer = 0
for i in range(1, n + 1):
	h -= 5 * i
	if h >= 0:
		answer += 1
	else:
		break
print(answer)


s = input()
a = s.split()
for i in range(len(a)):
	a[i] = int(a[i])
mt = 240 - a[1]
i = 1
while 5 * i <= mt and i <= a[0]:
	mt -= 5 * i
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
a = 240 - k
sum1 = 0
count = 0
for i in range(n):
	sum1 += (i + 1) * 5
	if sum1 <= a:
		count += 1
print(count)


(problems, distance) = [int(i) for i in input().split(' ')]
maximumTime = 4 * 60
maxProblems = 0
i = 1
while i <= problems:
	timeForExercises = i * (i + 1) / 2 * 5
	if maximumTime - timeForExercises - distance >= 0:
		maxProblems = maxProblems + 1
		i = i + 1
	else:
		break
print(maxProblems)


(x, y) = map(int, input().split())
n = 5 * ((1 + x) * (x / 2))
i = 0
if n + y <= 240:
	print(x)
elif n + y > 240:
	while i < x:
		i = i + 1
		if 5 * ((1 + i) * (i / 2)) > 240 - y:
			break
	print(i - 1)


(n, k) = list(map(int, input().split()))
r = 240 - k
total = 0
count = 0
for x in range(n):
	total += 5 * (x + 1)
	if total > r:
		break
	count += 1
print(count)


(n, k) = map(int, input().split())
for i in range(0, 100):
	if k + i * 5 > 240:
		print(min(i - 1, n))
		exit()
	k += i * 5


nk = input().split()
numOfQuestions = int(nk[0])
travelTimeToParty = int(nk[1])
timeWithLimak = 240 - travelTimeToParty
solveProblemIn = [5 * i for i in range(1, numOfQuestions + 1)]
count = 1
if timeWithLimak >= 5:
	for i in range(1, len(solveProblemIn)):
		solveProblemIn[i] = solveProblemIn[i - 1] + solveProblemIn[i]
		if solveProblemIn[i] <= timeWithLimak:
			count += 1
		else:
			break
	print(count)
else:
	print(0)


(n, k) = list(map(int, input().strip().split(' ')))
total = 240 - k
times = [i * (i + 1) * 5 // 2 for i in range(1, n + 1)]
for (i, time) in enumerate(times):
	if total < time:
		print(i)
		break
else:
	print(n)


(n, k) = map(int, input().split())
last = 240 - k
if last >= 5 * n * (n + 1) / 2:
	print(n)
else:
	a = list(range(1, n + 1))
	for i in range(n):
		p = 5 * a[i] * (a[i] + 1) / 2
		if last < p:
			print(i)
			break


(n, k) = map(int, input().split(' '))
timeLeft = 240 - k
problem = 0
count = 0
for i in range(1, n + 1):
	problem += i * 5
	if problem > timeLeft:
		break
	else:
		count += 1
print(count)


import math as m
l = [int(i) for i in input().strip().split()]
n = l[0]
k = l[1]
d = m.sqrt(40 * (240 - k) + 25)
ans = -0.5 + 0.1 * d
if ans >= n:
	print(n)
elif k > 240:
	print(0)
else:
	print(int(ans))


(n, t) = [int(i) for i in input().split()]
u = 240 - t
c = 0
i = 1
while i <= n:
	if u >= 5 * i:
		u = u - 5 * i
		c += 1
	i += 1
print(c)


import math
(n, k) = map(int, input().split())
left = 0
right = n + 1
while right - left > 1:
	mid = (right + left) // 2
	if 5 * sum([i for i in range(1, mid + 1)]) > 240 - k:
		right = mid
	else:
		left = mid
print(left)


(n, k) = map(int, input().split())
i = 0
c = 0
d = 1
while d <= n:
	if i + d * 5 <= 240 - k:
		i = i + d * 5
		c = c + 1
	else:
		break
	d += 1
print(c)


(n, k) = map(int, input().split())
(count, t_2_solve) = (0, 4 * 60 - k)
i = 1
while t_2_solve - i * 5 >= 0 and i <= n:
	t_2_solve -= i * 5
	i += 1
	count += 1
print(count)


(problemCount, timeForContest) = map(int, input().split())
timeForContest = 240 - timeForContest
answer = 0
i = 5
for _ in range(problemCount):
	if timeForContest // i > 0:
		timeForContest -= i
		i += 5
		answer += 1
print(answer)


(n, k) = map(int, input().split())
mins = 240 - k
count = 0
sum = 0
for i in range(1, n + 1):
	sum += 5 * i
	if sum > mins:
		break
	count += 1
print(count)


(n, k) = map(int, input().split())
count = 0
tot = 0
res = 240 - k
for i in range(1, n + 1):
	tot += 5 * i
	if tot > res:
		break
	count += 1
print(count)


(n, k) = map(int, input().split())
t = k
sum = 0
while t + (sum + 1) * 5 <= 240 and sum + 1 <= n:
	sum += 1
	t += sum * 5
print(sum)


(n, k) = [int(i) for i in input().split()]
for i in range(1, 12):
	if i * (i + 1) / 2 > (240 - k) // 5 or i == n + 1:
		print(i - 1)
		break


(m, n) = map(int, input().split())
cnt = 0
i = 1
save = n
while i <= m:
	if save + i * 5 <= 240:
		cnt += 1
		save += i * 5
		i += 1
	else:
		break
print(cnt)


(n, k) = map(int, input().split())
task_times = [5]
for i in range(n):
	if task_times[-1] > 240 - k:
		break
	t_t = (len(task_times) + 1) * 5 + task_times[-1]
	task_times.append(t_t)
print(len(task_times) - 1)


from math import *
nk = input()
n = int(nk.split()[0])
k = int(nk.split()[1])
s = float(240 - k) / 5.0
ans = floor((sqrt(1 + 8 * s) - 1) / 2.0)
if ans > n:
	print(n)
else:
	print(ans)


from math import floor
(a, b) = [int(i) for i in input().split()]
t = 4 * 60 - b
print(min(max(floor(-0.5 + (6.25 + 4 * 2.5 * t) ** 0.5 / 5), 0), a))


(n, k) = map(int, input().split())
time_all = 4 * 60
time_ost = time_all - k
kol = 0
i = 1
while time_ost - 5 * i >= 0 and i <= n:
	time_ost -= 5 * i
	i += 1
	kol += 1
print(kol)


def sint():
	return int(input())

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

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

def sstr():
	s = input()
	return list(s[:len(s)])

def main():
	(n, k) = sints()
	cnt = 0
	k = 240 - k
	t = 0
	for i in range(1, n + 1):
		if t + i * 5 <= k:
			cnt += 1
			t += i * 5
		else:
			break
	print(cnt)
main()


(n, k) = map(int, input().split())
hour = 240 - k
i = 5
x = 1
count = 0
while hour >= i * x:
	hour = hour - i * x
	count += 1
	x += 1
print(n if count >= n else count)


(n, m) = map(int, input().split())
k = 240 - m
summ = 0
count = 0
for i in range(1, n + 1):
	p = 5 * i
	summ += p
	if summ <= k:
		count += 1
	else:
		break
print(count)


import math
(n, k) = list(map(int, input().split()))
rem_time = 240 - k
p = 2 * rem_time / 5
max_n = math.floor(math.sqrt(2 * rem_time / 5))
if max_n * (max_n + 1) > p:
	max_n -= 1
if max_n > n:
	print(n)
else:
	print(max_n)


(n, mnt) = map(int, input().split())
tm = 240 - mnt
if tm < 5:
	print('0')
else:
	sm = 0
	i = 1
	while True and i <= n:
		sm += 5 * i
		if sm <= tm:
			i += 1
		else:
			break
	print(i - 1)


(n, k) = map(int, input().split())
cnt = 0
i = 1
while k <= 240 and i <= n:
	val = 5 * i
	k += val
	if k <= 240:
		cnt += 1
	i += 1
print(cnt)


n = [int(x) for x in input().split(' ')]
a = 240 - n[1]
t = 0
while a >= 0:
	t += 1
	a -= t * 5
	if a < 0:
		t -= 1
		break
	if t == n[0]:
		break
print(t)


x = input().split(' ')
(n, k) = (int(x[0]), int(x[1]))
time_left = 4 * 60
time_left -= k
count = 0
for problem in range(1, n + 1):
	if time_left - problem * 5 >= 0:
		time_left -= problem * 5
		count += 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
ta = 240 - k
t = 0
d = 0
for i in range(1, n + 1):
	t += i * 5
	if t > ta:
		print(i - 1)
		d = 1
		break
if d == 0:
	print(i)


(n, k) = map(int, input().split())
i = 0
if k > 235:
	print(i)
else:
	flag = 0
	for i in range(1, n + 1):
		k += 5 * i
		if k > 240:
			flag = 1
			break
	if flag:
		print(i - 1)
	else:
		print(n)


(n, k) = [int(i) for i in input().split()]
T = 240
time_contest = T - k
n_prob = 0
for i in range(n):
	time_contest -= (i + 1) * 5
	if time_contest >= 0:
		n_prob += 1
	else:
		break
print(n_prob)


import math
(n, k) = map(int, input().split())
x = (480 - 2 * k) / 5
i = int(math.floor((math.sqrt(1 + 4 * x) - 1) / 2))
if i > n:
	print(n)
else:
	print(i)


(n, k) = map(int, input().split())
(lb, ub) = (1, n)
while lb <= ub:
	mid = (lb + ub) // 2
	s = mid * (mid + 1) // 2
	s = s * 5
	if s + k <= 240:
		lb = mid + 1
	else:
		ub = mid - 1
print(ub)


s = input().split()
d = 240 - int(s[1])
t = 0
z = 0
for i in range(1, int(s[0]) + 1):
	t += 5 * i
	if t <= d:
		z += 1
print(z)


s = input()
s = s.split()
n = int(s[0])
k = int(s[1])
solve = 0
for i in range(1, n + 1):
	k += i * 5
	if k < 241:
		solve += 1
	else:
		break
print(solve)


import sys

def main():
	(n, k) = [int(s) for s in sys.stdin.readline().split()]
	tmax = 60 * 4
	t = k
	i = 1
	while t + 5 * i <= tmax and i <= n:
		t += 5 * i
		i += 1
	print(i - 1)
main()


(n, k) = map(int, input().split())
t = 240 - k
i = 5
count = 0
s = 0
while s <= t:
	count += 1
	s += count * i
if count > n:
	print(n)
else:
	print(count - 1)


def newyear(n, k):
	r = 240 - k
	count = 0
	for i in range(n):
		if 5 * (i + 1) <= r:
			count = count + 1
			r = r - 5 * (i + 1)
	return count
(n, k) = map(int, input().split())
print(newyear(n, k))


time = 240
(n, k) = map(int, input().split())
dif = time - k
i = 1
s = 0
while dif >= i * 5 + s and i <= n:
	s += i * 5
	i += 1
print(i - 1)


string = input()
numbers = string.split(' ')
problems = int(numbers[0])
minutes = int(numbers[1])
total = 0
i = 0
while total <= 240 - minutes and i <= problems:
	i += 1
	total += i * 5
print(i - 1)


lst = list(map(int, input().rstrip().split()))
num = lst[0]
count = 0
t = lst[1]
s = 0
m = []
for i in range(num):
	s = s + 5
	m.append(s)
	x = sum(m)
	y = 240 - t
	if x <= y:
		count += 1
	else:
		break
print(count)


gi = lambda : int(input())
gai = lambda : list(map(int, input().split()))
(n, k) = gai()
t = 240
i = 1
while True:
	t -= i * 5
	if t < k:
		break
	i += 1
print(min(n, i - 1))


(n, k) = map(int, input().split())
t = 4 * 60 - k
nz = 1
t -= nz * 5
while t >= 0 and nz <= n:
	nz += 1
	t -= nz * 5
print(nz - 1)


(n, k) = map(int, input().split())
remain = 240 - k
solve = 0
flag = 0
for i in range(n, -1, -1):
	solve = 5 * (i * (i + 1) // 2)
	if solve <= remain:
		print(i)
		break


import math
(n, k) = map(int, input().split())
a = (240 - k) * 2 / 5
k = int(math.sqrt(a))
k = k - 1 if k * (k + 1) > a else k
print(min(k, n))


def bl(a, x):
	l = 0
	h = 9
	ans = -1
	while l <= h:
		m = (l + h) // 2
		if a[m] <= x:
			ans = m
			l = m + 1
		else:
			h = m - 1
	return ans
a = [5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
(n, k) = list(map(int, input().split()))
l = 0
h = 240 - k
ans = 0
while l <= h:
	m = (l + h) // 2
	ind = bl(a, m)
	if ind + 1 == n:
		print(ind + 1)
		break
	if ind < n:
		ans = ind + 1
		l = m + 1
	else:
		h = m - 1
else:
	print(ans)


def r(t=int):
	return list(map(t, input().split()))

def ri(t=int):
	return t(input())

def cd(it):
	ret_val = dict()
	for v in it:
		ret_val[v] = ret_val.get(v, 0) + 1
	return ret_val
(a, b) = r()
d = (240 - b) // 5
ans = 0
while d > 0:
	ans += 1
	d -= ans
if d < 0:
	ans -= 1
print(min(ans, a))


(n, k) = map(int, input().split())
mins = k
prob = 0
while mins + (prob + 1) * 5 <= 240 and prob < n:
	mins += (prob + 1) * 5
	prob += 1
print(prob)


(n, k) = map(int, input().split())
limit = 240
val = k
ans = 0
for i in range(1, n + 1):
	if i * 5 + val <= limit:
		val += i * 5
		ans = i
	else:
		break
print(ans)


[n, k] = list(map(int, input().split()))
p = 240 - k
t = int(((25 + 40 * p) ** 0.5 - 5) / 10)
print(min(t, n), end='')


from math import sqrt
a = input()
b = a.split()
c = 240 - int(b[1])
count = 0
while c >= 0:
	c -= (count + 1) * 5
	count += 1
print(min(int(b[0]), count - 1))


(N, K) = [int(x) for x in input().split()]
L = [int(x * 5) for x in range(1, N + 1)]
M = 240 - K
for i in range(1, N):
	L[i] = L[i] + L[i - 1]
O = L.index(min(L, key=lambda x: abs(x - M))) + 1
if L[O - 1] <= M:
	print(O)
else:
	print(O - 1)


(a, b) = map(int, input().split())
time = 240 - b
k = 1
count = 0
while time > 0:
	if k * 5 <= time:
		time -= k * 5
		k += 1
		count += 1
		if count == a:
			break
	else:
		break
print(count)


inpt = str(input())
inpt = inpt.split(' ')
probs = int(inpt[0])
timt = int(inpt[1])
timto = 240 - timt
k = 0
x = 1
while x < probs + 1 and timto > 0:
	timeto = x * 5
	timto = timto - timeto
	if timto >= 0:
		k += 1
	x += 1
print(k)


a = list(map(int, input().strip().split(' ')))
n = 0
c = 0
k = 240 - a[1]
for i in range(1, a[0] + 1):
	n += 5 * i
	if n > k:
		break
	c += 1
print(c)


num = list(map(int, input().split()))
n = num[0]
t = 240 - num[1]
i = 0
while i <= n:
	t -= 5 * i
	if t < 0:
		break
	i += 1
print(i - 1)


def main():
	(n, k) = [int(_) for _ in input().split()]
	t = 240 - k
	ans = 0
	timeSpent = 0
	timeRequired = 5
	while ans < n and timeSpent < t:
		if timeSpent + timeRequired <= t:
			timeSpent += timeRequired
			ans += 1
		else:
			break
		timeRequired += 5
	print(ans)
main()


(n, k) = input().split()
(n, k) = (int(n), int(k))
t = 0
c = 0
for i in range(1, n + 1):
	t += 5 * i
	if t > 4 * 60 - k:
		break
	c += 1
print(c)


def main():
	(n, k) = map(int, input().split())
	cost = k
	after = 5
	ans = 0
	while ans < n and cost + after <= 240:
		cost += after
		ans += 1
		after += 5
	print(ans)
main()


n = list(map(int, input().split()))
s = 1440
t = 1200
b = 0
for i in range(1, n[0] + 1):
	t = t + 5 * i
	z = s - t
	if z == n[1]:
		b = b + 1
		break
	elif z < n[1]:
		break
	else:
		b = b + 1
print(b)


(n, k) = list(map(int, input().split()))
sumi = 0
i = 1
res = 0
while k + sumi <= 4 * 60 and n != 0:
	sumi += i * 5
	if k + sumi > 4 * 60:
		break
	i += 1
	n -= 1
	res += 1
print(res)


(n, k) = map(int, input().split())
m = (0.25 + 96 - 0.4 * k) ** 0.5 - 0.5
print(min(int(m), n))


import math
(n, k) = [int(x) for x in input().split()]
goal = math.floor((240 - k) / 5)
m = math.floor((-1 + math.sqrt(8 * goal + 1)) / 2)
m = min(max(0, m), n)
print(m)


def binarySearch(pt, t):
	high = len(pt) - 1
	low = 1
	ans = 0
	while low <= high:
		mid = low + (high - low) // 2
		if pt[mid] <= t:
			ans = mid
			low = mid + 1
		else:
			high = mid - 1
	return ans
x = [int(i) for i in input().split()]
i = 1
pt = [0]
while i <= x[0]:
	pt.append(i * 5 + pt[i - 1])
	i = i + 1
t = 240 - x[1]
print(binarySearch(pt, t))


s = input()
x = s.split()
n = int(x[0])
k = int(x[1])
time = 4 * 60
spent = 0
remaining = time - k
c = 0
for i in range(1, n + 1):
	spent = spent + 5 * i
	if spent > remaining:
		break
	else:
		c = c + 1
print(c)


(n, k) = input().split()
(n, k) = (int(n), int(k))
ans = int(((240 - k) * 2 / 5) ** (1 / 2))
print(min(ans, n)) if ans * (ans + 1) * 5 / 2 <= 240 - k else print(min(ans - 1, n))


(n, k) = map(int, input().split())
nt = 240 - k
i = 1
while 1 and i <= n:
	nt -= 5 * i
	if nt < 0:
		break
	i += 1
print(i - 1)


(n, k) = tuple(map(int, input().strip(' ').split(' ')))
a = [i * 5 for i in range(1, n + 1)]
total = sum(a)
c = n - 1
while total + k > 240:
	total = total - a[c]
	c -= 1
print(c + 1)


(n, k) = [int(i) for i in input().split()]
num = 240
remain = 240 - k
p = 0
for i in range(1, n + 1):
	a = 5 * i
	if remain >= 0:
		remain = remain - a
		if remain >= 0:
			p += 1
print(p)


(n, k) = map(int, input().split())
left = 240 - k
x = 0
for i in range(n + 1):
	x += 5 * i
	if left - x < 0:
		exit(print(max(0, i - 1)))
print(n)


(n, k) = map(int, input().split())
D = 9625 - 40 * k
x = int((D ** (1 / 2) - 5) // 10)
if x <= n:
	print(x)
else:
	print(n)


(y, b) = [int(i) for i in input().split()]
minutes = 240 - b
count = 0
if minutes > 0:
	for i in range(1, y + 1):
		if i * 5 <= minutes:
			minutes -= i * 5
			count += 1
	print(count)
else:
	print(count)


def main():
	q = input().split()
	n = int(q[0])
	home = int(q[1])
	have = 240 - home
	k = 0
	for i in range(n):
		if have - 5 * (i + 1) >= 0:
			k += 1
			have -= 5 * (i + 1)
	print(k)
main()


def time(problems, time):
	cnt = 0
	for i in range(1, problems + 1):
		time += 5 * i
		if time <= 240:
			cnt += 1
	return cnt
(a, b) = map(int, input().strip().split())
print(time(a, b))


(n, k) = map(int, input().split())
z = 0
m = 0
s = 0
while k + s <= 240 and z <= n:
	z = z + 1
	m = m + 5
	s = s + m
print(z - 1)


(n, k) = map(int, input().split())
p = 0
x = 0
t = int(240 - k)
if 1 <= n <= 10 and 1 <= k <= 240:
	while x < n and t - x * 5 >= 5:
		x = x + 1
		t = t - x * 5
		p = p + 1
	print(p)


(n, m) = map(int, input().split())
k = 1
while 1:
	t = k * (5 + (5 + (k - 1) * 5)) // 2 + m
	if t == 240:
		print(k)
		break
	elif t > 240:
		print(k - 1)
		break
	elif k == n:
		print(k)
		break
	k += 1


(n, m) = map(int, input().split())
min = 240 - m
(count, value) = (0, 0)
if min < 5:
	count = 0
for i in range(5, 5 * (n + 1), 5):
	value += i
	if value <= min:
		count += 1
print(count)


(n, k) = map(int, input().split())
a = [5, 15, 30, 50, 75, 105, 140, 180, 225]
cnt = 0
for i in a[:n]:
	if i + k > 240:
		break
	cnt = cnt + 1
print(cnt)


(n, k) = map(int, input().split(' '))
t = 240 - k
c = -1
list1 = [0, 5, 15, 30, 50, 75, 105, 140, 180, 225]
for i in range(10):
	if t >= list1[i]:
		c += 1
	else:
		break
print(min(n, c))


(a, b) = map(int, input().split())
d = 0
e = 5
while 240 >= b:
	b = b + e
	e = e + 5
	d = d + 1
if d > a:
	print(a)
else:
	print(d - 1)


[n, k] = [int(x) for x in input().split()]
time_left = 240 - k
count = 0
i = 1
while count + 5 * i <= time_left and i <= n:
	count += 5 * i
	i += 1
print(i - 1)


(n, m) = map(int, input().split())
remaining = 240
remaining -= m
su = 0
i = 1
while True:
	if i > n:
		break
	if remaining >= i * 5:
		remaining -= int(i * 5)
		su += 1
	else:
		break
	i += 1
print(su)


(number_of_tasks, travel_time) = map(int, input().split())
time_for_tasks = 0
task_number = 0
while time_for_tasks <= 240 - travel_time:
	time_for_tasks += task_number * 5
	if time_for_tasks + (task_number + 1) * 5 > 240 - travel_time or task_number >= number_of_tasks:
		break
	task_number += 1
print(task_number)


(N, K) = list(map(int, input().split()))
M = 240 - K
C = 0
for P in range(1, N + 1):
	N = 5 * P
	if M - N >= 0:
		C += 1
		M -= N
	else:
		break
print(C)


(k, n) = map(int, input().split())
vol = 0
for i in range(k):
	if n <= 240 and 5 * (i + 1) + n <= 240:
		vol += 1
		n += 5 * (i + 1)
	else:
		break
	if n >= 240:
		break
print(vol)


b = input()
b = b.split()
ques = int(b[0])
t2t = int(b[1])
count = 240
time = count - t2t
i = 1
while time >= 0:
	time = time - i * 5
	i = i + 1
if i - 2 >= ques:
	print(ques)
else:
	print(i - 2)


(n, k) = (int(i) for i in input().split())
pa = 0
k = 240 - k
while pa < n and (pa + 1) * 5 <= k:
	pa += 1
	k -= pa * 5
print(pa)


(n, k) = input().split()
n = int(n)
k = int(k)
times = [x * 5 for x in range(n + 1)]
times = times[1:]
timeLeft = 240 - k
if sum(times) <= timeLeft:
	print(n)
else:
	while sum(times) > timeLeft:
		times.pop()
	print(len(times))


(n, k) = map(int, input().split())
(sum, count) = (0, 0)
max = 4 * 60
for i in range(1, n + 1):
	sum += 5 * i
	if max - k >= sum:
		count += 1
	else:
		break
print(count)


theinput = input()
problems = int(theinput.split(' ')[0])
timetotake = int(theinput.split(' ')[1])
result = 0
if problems >= 1 and problems <= 10 and (timetotake >= 1) and (timetotake <= 240):
	for i in range(1, problems + 1):
		if timetotake + i * 5 > 240:
			result = i - 1
			break
		timetotake += i * 5
	else:
		result = i
print(str(result))


(n, m) = tuple(map(int, input().split()))
ost = 240 - m
s = 0
count = 0
for i in range(1, n + 2):
	if s == ost:
		break
	if s > ost:
		count -= 1
		break
	s += 5 * i
	count += 1
if count > n:
	print(n)
else:
	print(count)


in1 = input().split()
prob = int(in1[0])
time_house = int(in1[1])
time_left = 240 - time_house
time2 = 0
count = 0
for i in range(prob):
	time2 += 5 * (i + 1)
	if time2 <= time_left:
		count += 1
	else:
		break
print(count)


s = [int(n) for n in input().split()]
n = s[0]
k = s[1]
actualTime = 240 - k
probTime = 0
for i in range(1, n + 2):
	probTime += i * 5
	if probTime > actualTime:
		break
print(i - 1)


s = list(map(int, input().split()))
(s, x) = (s[0], s[1])
time = 240 - x
count = 5
questions = 0
while time > 0 and s > 0:
	time -= count
	count += 5
	questions += 1
	s -= 1
	if time < 0:
		questions -= 1
print(questions)


L = input()
L = L.split()
n = int(L[0])
k = int(L[1])
tt = 240 - k
c = 0
F = 0
i = 1
while F + 5 * i <= tt:
	F = F + 5 * i
	i += 1
	c += 1
if c < n:
	print(c)
else:
	print(n)


nk = input().rstrip().split()
n = int(nk[0])
k = int(nk[1])
l = 240 - k
count = 0
for i in range(1, n + 1):
	s = 5 * i
	if l >= s:
		count += 1
		l = l - s
	else:
		break
print(count)


(n, k) = map(int, input().split())
s = []
count = 0
if k == 240:
	print('0')
else:
	for i in range(n):
		i = i + 1
		a = 5 * i
		count = count + a
		l = 240 - k
		if count <= l:
			s.append(i)
	if len(s) > 0:
		d = s[0]
		for i in range(len(s) - 1):
			if s[i] < s[i + 1]:
				d = s[i + 1]
		print(d)
	else:
		print('0')


(n, k) = map(int, input().split())
time_for_round = 4 * 60 - k
sum = 0
k = 0
while sum + 5 * (k + 1) <= time_for_round and k < n:
	k += 1
	sum += 5 * k
print(k)


(n, k) = map(int, input().split())
total = count = 0
x = 5
while total + x <= 240 - k and count < n:
	total += x
	count += 1
	x += 5
print(count)


(n, k) = map(int, input().split())
remain = 240 - k
count = 0
i = 1
while True:
	count += 5 * i
	if count > remain:
		if i - 1 <= n:
			print(i - 1)
			break
		else:
			print(n)
			break
	i += 1


def solve(n, k):
	timeset = 0
	timeao = 0
	count = 0
	if k >= 240:
		return 0
	for i in range(1, n + 1):
		if 240 - k < i * 5:
			return 0
		timeset += i * 5
		count += 1
		timeao = timeset + (i + 1) * 5
		if timeao + k > 240:
			return count
	return count
(n, k) = map(int, input().split())
print(solve(n, k))


import math
(n, k) = map(int, input().split())
print(int(math.floor((1.6 * (240 - k) + 1) ** 0.5 - 1) / 2) if int(math.floor((1.6 * (240 - k) + 1) ** 0.5 - 1) / 2) <= n else n)


(n, k) = map(int, input().split())
s = 24 * 60 - 20 * 60 - k
nb = 0
t = 0
i = 1
while i <= n and t <= s:
	t += i * 5
	i += 1
	if t <= s:
		nb += 1
print(nb)


(n, k) = map(int, input().strip().split(' '))
remain_time = 240 - k
spent_time = 0
counter = 0
for i in range(1, n + 1):
	spent_time += 5 * i
	if spent_time <= remain_time:
		counter += 1
	else:
		continue
print(counter)


from sys import stdin, stdout
inp = stdin.readline
out = stdout.write
(n, k) = map(int, inp().strip().split())
(rt, c, s) = (240 - k, 0, 0)
for i in range(1, n + 1):
	s += 5 * i
	if s <= rt:
		c += 1
	else:
		break
print(c)


(k, r) = map(int, input().split())
c = 0
x = 240 - r
for i in range(1, k + 1):
	if x - 5 * i >= 0:
		x -= 5 * i
		c += 1
	else:
		break
print(c)


(n, k) = [int(i) for i in input().strip().split()]
k = (240 - k) / 5
i = 1
while (i + 1) * i / 2 <= k:
	i += 1
print(min(i - 1, n))


def solve(n, k):
	r = 240 - k
	x = 0
	while 0 <= r:
		x += 1
		r -= 5 * x
	return min(x - 1, n)
(n, k) = map(int, input().split())
print(solve(n, k))


[a, b] = [int(i) for i in input().split()]
print(min((int((1 + 8 * (240 - b) // 5) ** 0.5) - 1) // 2, a))


p = input().rstrip().split(' ')
t = 240 - int(p[1])
X = 0
for i in range(0, int(p[0])):
	T = 5 * (i + 1)
	if T <= t:
		t = t - T
		X += 1
print(X)


def main():
	(n, k) = map(int, input().split())
	x = 240 - k
	for i in range(n):
		t = (i + 1) * 5
		if x < t:
			print(i)
			return
		x -= t
	print(n)
main()


def compute_number_of_problems_solved(N, allowed_minutes):
	problem_count = 0
	for i in range(1, N + 1):
		allowed_minutes = allowed_minutes - 5 * i
		if allowed_minutes < 0:
			break
		problem_count += 1
	return problem_count

def main(N, K):
	answer = compute_number_of_problems_solved(N, 4 * 60 - K)
	print(answer)
	return answer
(N, K) = input().split()
main(int(N), int(K))


(n, m) = list(map(int, input().split()))
t = m + 20 * 60
i = 1
while t < 1440:
	t = t + 5 * i
	if t <= 1440:
		i = i + 1
if i - 1 > n:
	print(n)
else:
	print(i - 1)


(a, b) = map(int, input().strip().split())
c = b
p = 0
for n in range(1, a + 1):
	c = c + 5 * n
	if c > 240:
		break
	elif c <= 240:
		p = p + 1
print(p)


(n, k) = map(int, input().split())
kk = (240 - k) // 5
res = 0
for i in range(1, n + 1):
	if i * (i + 1) // 2 <= kk:
		res = i
	else:
		break
print(res)


remainder = 240
(n, k) = map(int, input().split(' '))
count = 0
i = 1
remainder -= k
while i <= n:
	remainder -= i * 5
	if remainder < 0:
		break
	count += 1
	i += 1
print(count)


(x, y) = [int(x) for x in input().split()]
total = 240 - int(y)
i = 0
while total >= 0 and i <= int(x):
	total = total - 5 * (i + 1)
	i += 1
print(i - 1)


d = list(map(int, input().split()))
f = 240 - d[1]
count = 0
for i in range(1, d[0] + 1):
	d = i * 5
	if f - d >= 0:
		count += 1
		f = f - d
	else:
		break
print(count)


(n, k) = map(int, input().split())
ak = 240 - k
tk = 5 * (n * (n + 1)) // 2
ans = 0
if ak >= tk:
	print(n)
else:
	for i in range(n):
		if i * (i + 1) // 2 <= ak // 5:
			ans = i
	print(ans)


def main():
	(n, k) = map(lambda x: int(x), input().split())
	solved = 0
	timeLeft = 240 - k
	while solved < n:
		timeLeft -= 5 * (solved + 1)
		if timeLeft < 0:
			break
		else:
			solved += 1
	print(solved)
main()


(n, m) = [int(i) for i in input().split()]
time = 240 - m
if time < 5:
	print(0)
else:
	s = 1
	t = 5
	k = 1
	while t <= time and k < n:
		k = k + 1
		s = sum(list(range(1, k + 1)))
		t = 5 * s
	if t > time:
		k = k - 1
	print(k)


(n, k) = [int(x) for x in input().split(' ')]
p = 0
t = 240 - k
for i in range(n):
	if t - (i + 1) * 5 >= 0:
		t -= (i + 1) * 5
		p += 1
	else:
		break
print(p)


def bisectionsearch(L, left, right, k):
	mid = (left + right) // 2
	if right - left == 1:
		return left
	elif k == L[left]:
		return left
	elif k == L[right]:
		return right
	elif k == L[mid]:
		return mid
	elif L[left] <= k < L[mid]:
		return bisectionsearch(L, left, mid, k)
	elif L[mid] <= k < L[right]:
		return bisectionsearch(L, mid, right, k)
	else:
		return -1
nk = input().split()
n = int(nk[0])
k = int(nk[1])
time = 240 - k
if 2.5 * n * (n + 1) <= 240 - k:
	print(n)
else:
	L = [2.5 * i * (i + 1) for i in range(n + 1)]
	print(bisectionsearch(L, 0, n, time))


(Problems, timeSubstract) = [int(x) for x in input().split()]
time = 240 - timeSubstract
if time < 0:
	time = 0
n = 0
while (n + 1) * (n + 2) <= time * 2 / 5 and n + 1 <= Problems:
	n += 1
print(n)


(n, k) = map(int, input().split())
time = 240
i = 1
while time >= k and i - 2 < n:
	time = time - 5 * i
	i = i + 1
print(i - 2)


(n, k) = input().split()
n = int(n)
k = int(k)
k = 240 - k
i = 0
x = 0
while k >= 5:
	if k - x < 5:
		break
	x = x + 5
	k = k - x
	i += 1
	continue
if i > n:
	print(n)
else:
	print(i)


s = input().split()
a = int(s[0])
b = int(s[1])
stepper = 0
time_for_practice = 240 - b
for i in range(1, a + 1):
	stepper += i * 5
	if stepper > time_for_practice:
		print(i - 1)
		break
	if i == a:
		print(a)


import math

def max_problems(n, k):
	delta = 1 - 4 * (-96 + 2 * k / 5)
	if delta >= 0:
		x = (-1 + math.sqrt(delta)) // 2
		return min(n, int(x))
	else:
		return 0
(a, b) = map(int, input().split())
print(max_problems(a, b))


(n, m) = list(map(int, input().split()))
a = 240 - m
b = 0
i = 1
while a >= i * 5 and b < n:
	a -= i * 5
	b += 1
	i += 1
print(b)


import sys
(n, k) = map(int, sys.stdin.readline().split())
k = 240 - k
k = k // 5
z = 0
for i in range(1, 11):
	z += i
	if z == k:
		if i > n:
			print(n)
		else:
			print(i)
		break
	elif z > k:
		if i - 1 > n:
			print(n)
		else:
			print(i - 1)
		break


(a, b) = map(int, input().split())
k = 0
i = 5 * k
s = 0
while i <= 240 - b and s <= a:
	s += 1
	k += 1
	i += 5 * k
print(s - 1)


(n, k) = map(int, input().split())
m = 0
while 5 * m * (m + 1) <= 2 * (240 - k) and m <= n:
	m += 1
print(m - 1)


(n, k) = map(int, input().split())
zadaciukupno = 0
for i in range(1, n + 1):
	zadaciukupno += i * 5
	if k + zadaciukupno == 240:
		print(i)
		quit()
	elif k + zadaciukupno > 240:
		print(i - 1)
		quit()
print(i)


l = list(map(int, input().split()))
t = 240 - l[1]
su = 0
for i in range(1, l[0] + 1):
	su += 5 * i
	if su == t:
		print(i)
		exit()
	elif su > t:
		print(i - 1)
		exit()
if su < t:
	print(l[0])
else:
	print(0)


from collections import *
from sys import *
inp = stdin.readline
out = print
timer = 240
(n, k) = map(int, inp().split())
timerleft = timer - k
count = 0
for i in range(1, n + 1):
	timerleft = timerleft - 5 * i
	if timerleft >= 0:
		count += 1
	else:
		break
print(count)


time = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
(n, k) = input().split(' ')
n = int(n)
k = int(k)
c = 0
for i in range(0, n):
	if 240 - k < time[i]:
		break
	else:
		k += time[i]
		c += 1
print(c)


m = (24 - 20) * 60
(n, k) = map(int, input().split())
m -= k
if m == 0:
	print(0)
else:
	i = 1
	while i <= n:
		m -= 5 * i
		if m < 0 and i != 1:
			print(i - 1)
			break
		if m < 0 and i == 1:
			print(0)
			break
		if m == 0:
			print(i)
			break
		i += 1
if m > 0:
	print(n)


s = input().split()
n = int(s[0])
k = int(s[1])
seconds = 240 - k
count = 0
for i in range(1, n + 1):
	if 5 * i <= seconds:
		seconds -= 5 * i
		count += 1
print(count)


num = list(map(int, input().split()))
n = num[0]
k = num[1]
time = list()
for i in range(1, n + 1):
	time.append(5 * i)
q = 0
summa = 0
for i in range(n):
	summa += time[i]
	if k <= 240 - summa:
		q += 1
print(q)


(prob, mins) = list(map(int, input().split(' ')))
left_mins = 240 - mins
solved_prob = 0
for _ in range(1, prob + 1):
	if left_mins - _ * 5 >= 0:
		solved_prob += 1
		left_mins -= _ * 5
print(solved_prob)


(n, time) = map(int, input().split())
a = 240 - time
c = 0
l1 = []
for i in range(1, n + 1):
	if sum(l1) < a:
		l1.append(5 * i)
if sum(l1) > a:
	print(len(l1) - 1)
else:
	print(len(l1))


(n, m) = map(int, input().split())
opstatok_vremeni = 4 * 60 - m
count = 0
vremya_na_zadachu = 0
obchee_vremya = 0
while count < n:
	if obchee_vremya <= opstatok_vremeni - (vremya_na_zadachu + 5):
		count += 1
		vremya_na_zadachu += 5
		obchee_vremya += vremya_na_zadachu
	else:
		break
print(count)


(n, k) = map(int, input().split())
t = 240 - k
tmp = 0
for i in range(n):
	tmp += 5 * (i + 1)
	if tmp > t:
		print(i)
		exit()
print(n)


(n, k) = map(int, input().split())
time_left = 240 - k
time_questions = []
for i in range(1, n + 1):
	time_questions.append(5 * i)
total_time_solving = 0
questions_solved = 0
for i in range(0, len(time_questions)):
	if time_questions[i] + total_time_solving <= time_left:
		questions_solved += 1
		total_time_solving += time_questions[i]
	else:
		break
print(questions_solved)


a = input()
n = int(a.split()[0])
k = int(a.split()[1])
d = 240 - k
t = 0
count = 0
ans = 0
for i in range(n):
	t += 5 * (i + 1)
	if t > d:
		ans = count
		break
	count += 1
ans = count
print(ans)


time_min = 240
deneme = 0
c = 0
(a, b) = [int(i) for i in input().split(' ')]
time = time_min - b
for i in range(1, a + 1):
	deneme += 5 * i
	if deneme <= time:
		c += 1
print(c)


n = [int(i) for i in input().split()]
t = 240 - n[1]
i = 1
while 5 * i <= t and i <= n[0]:
	t -= 5 * i
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
a = [5]
for i in range(2, n + 1):
	a.append(a[-1] + i * 5)
rem = 240 - k
ans = 0
for x in a:
	if x > rem:
		break
	ans += 1
print(ans)


(n, k) = [int(x) for x in input().split()]
left = 240 - k
done = 0
for i in range(1, n + 1):
	if left >= 5 * i:
		done += 1
		left -= 5 * i
	else:
		break
print(done)


(n, k) = map(int, input().split())
x = 240 - k
i = 1
count = 0
while count < n:
	y = 5 * i
	if x - y < 0:
		break
	x -= y
	i += 1
	count += 1
print(count)


def main():
	(n, m) = map(int, input().split(' '))
	m = 240 - m
	i = 0
	while i < n:
		if m - (i + 1) * 5 >= 0:
			m -= (i + 1) * 5
		else:
			break
		i += 1
	print(i)
main()


str = input()
str1 = str.split()
n = str1[0]
k = str1[1]
rem = 240 - int(k)
time = 5
i = 1
count = 0
while time <= rem and count < int(n):
	count = count + 1
	rem = rem - time
	i = i + 1
	time = 5 * i
print(count)


list1 = input().split()
list2 = [int(i) for i in list1]
n = list2[0]
k = list2[1]
while n * (n + 1) / 2 * 5 + k > 240:
	n -= 1
print(n)


(n, k) = list(map(int, input().split()))

def f(i):
	return 240 - k - 5 * (i * (i + 1)) // 2 >= 0
left = 0
right = n + 1
while left != right - 1:
	mid = (left + right) // 2
	if f(mid):
		left = mid
	else:
		right = mid
print(left)


(n, k) = input().split()
time = 240 - int(k)
n = int(n)
i = 1
elapsed = 0
while True:
	elapsed += 5 * i
	if elapsed > time:
		break
	else:
		i += 1
i -= 1
if i > n:
	print(n)
else:
	print(i)


(ques, time) = map(int, input().split())
rem_time = int(240 - time)
to_solve = 0
i = 0
status = False
while to_solve <= rem_time:
	if i == ques:
		status = True
		break
	i += 1
	to_solve += 5 * i
if status == True:
	print(i)
else:
	print(i - 1)


st = input()
l = st.split(' ')
n = int(l[0])
k = int(l[1])
timel = 240 - k
timet = 0
count = 0
flag = 0
for i in range(1, n + 1):
	timet = timet + int(i) * 5
	if timet > timel:
		print(count)
		flag = 1
		break
	count += 1
if flag == 0:
	print(count)


nk = list(map(int, input().split()))
freetime = 240 - nk[1]
tasks = 0
taskstime = 0
for i in range(1, nk[0] + 1):
	taskstime += 5 * i
	if taskstime <= freetime:
		tasks += 1
	else:
		break
print(tasks)


(assignments, minutes_way) = map(int, input().split())
done_assignments = 0
minutes_assignments = 0
all_time = minutes_assignments + minutes_way
while done_assignments != assignments and (done_assignments + 1) * 5 + all_time <= 240:
	done_assignments += 1
	minutes_assignments = 5 * done_assignments
	all_time = minutes_assignments + all_time
print(done_assignments)


count = 0
sum = 0
(n, k) = map(int, input().split())
b = 240 - k
i = 1
while i <= n:
	sum += i * 5
	if sum > b:
		break
	count += 1
	i += 1
print(count)


(n, k) = map(int, input().split())
l = [5, 15, 30, 50, 75, 105, 140, 180, 225, 240]
j = n - 1
d = 240 - k
while j >= 0 and l[j] > d:
	j = j - 1
print(j + 1)


(a, b) = map(int, input().split())
x = (240 - b) // 5
l = []
for i in range(a + 1):
	if int(i * (i + 1) // 2) <= x:
		l.append(i)
if max(l) >= a:
	print(a)
else:
	print(max(l))


(n, k) = map(int, input().split())
tim = 240 - k
dem = 0
for i in range(1, n + 1):
	if tim >= 5 * i:
		tim -= 5 * i
		dem += 1
	else:
		break
print(dem)


(n, k) = map(int, input().split())
time = 4 * 60
count = 0
currentTime = k
for i in range(n):
	currentTime += 5 * (i + 1)
	if currentTime > time:
		break
	count += 1
print(count)


(a, b) = map(int, input().split())
us = 240
ss = 0
zaman = 0
for i in range(1, a + 1):
	zaman += i * 5
	if b + zaman <= 240:
		ss += 1
print(ss)


(n, t) = map(int, input().split())
i = 1
tot = 240
tot = tot - t
ti = 0
c = 0
for i in range(1, n + 1):
	ti = ti + i * 5
	if ti <= tot:
		c += 1
	else:
		break
print(c)


x = input().split()
z = 240 - int(x[1])
w = 0
for i in range(1, int(x[0]) + 1):
	z = z - i * 5
	if z < 0:
		break
	else:
		w = w + 1
print(w)


(N, K) = [int(n) for n in input().split()]
minsLeft = 4 * 60 - K
end = False
for n in range(1, N + 1):
	minsLeft -= 5 * n
	if minsLeft < 0:
		print(n - 1)
		end = True
		break
if not end:
	print(N)


TN = 1

def solution():
	(n, k) = map(int, input().split())
	s = (240 - k) // 5
	ans = 0
	for i in range(1, n + 1):
		if i <= s:
			ans += 1
			s -= i
		else:
			break
	print(ans)
while TN != 0:
	solution()
	TN -= 1


(a, b) = map(int, input().split(' '))
c = 240 - b
j = 0
k = 1
while j <= c:
	j += 5 * k
	k += 1
k -= 2
if k >= a:
	print(a)
else:
	print(k)


ins = input().strip().split(' ')
(n, k) = (int(ins[0]), int(ins[1]))
total = 0
start = k
index = n
for i in range(1, n + 1):
	total += 5 * i
	if total + start > 240:
		i -= 1
		index = i
		break
print(index)


(n, k) = [int(x) for x in input().split()]
time = 240 - k
count = 0
ex_time = 0
for x in range(n):
	ex_time += 5 * (x + 1)
	if ex_time > time:
		break
	count += 1
print(count)


(n, k) = map(int, input().split())
t = 240 - k
c = 0
a = 0
for i in range(1, n + 1):
	c = c + 5 * i
	if t - c >= 0:
		a += 1
print(a)


import sys
import math as mt
t = 1
for __ in range(t):
	(n, k) = map(int, input().split())
	have = 240 - k
	maxi = 0
	ans = 0
	for i in range(1, n + 1):
		if ans + 5 * i <= have:
			ans += 5 * i
			maxi += 1
	print(maxi)


def main():
	[n, k] = [int(_) for _ in input().split()]
	maxi = (240 - k) // 5
	while n > 0 and n * (n + 1) // 2 > maxi:
		n -= 1
	print(n)
main()


minutes = 240
(prob, time) = map(int, input().split())
minutes -= time
t = c = 0
for i in range(1, prob + 1):
	t += 5 * i
	if t <= minutes:
		c += 1
	else:
		break
print(c)


(n, k) = map(int, input().split())
x = 240 - k
i = 0
i5 = 0
while x > 0:
	if i == n:
		break
	i5 += 5
	if x - i5 < 0:
		break
	x -= i5
	i += 1
print(i)


(n, t) = [int(i) for i in input().split()]
remTime = 240 - t
count = 0
for i in range(1, n + 1):
	if remTime < 5 * i:
		break
	remTime -= 5 * i
	count += 1
print(count)


from sys import setrecursionlimit, exit
from math import ceil, floor, acos, pi
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from functools import reduce
from collections import Counter
from itertools import permutations, combinations
import queue
setrecursionlimit(10 ** 7)
RI = lambda x=' ': list(map(int, input().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
mod = int(1000000000.0 + 7)
eps = 1e-06
MAX = 2 ** 32 - 1
(n, k) = RI()
t = 240 - k
a = 0
while t >= (a + 1) * 5 and a < n:
	a += 1
	t -= a * 5
print(a)


(quest, min) = map(int, input().split())
contest = 240 - min
cont = 0
for x in range(1, quest + 1):
	contest -= x * 5
	cont += 1
	if contest < 0:
		cont -= 1
		if contest == 0:
			cont += 1
			break
		break
print(cont)


from itertools import permutations
(n, k) = map(int, input().split())
ans = 0
cur = 4 * 60 - k
for i in range(1, n + 1):
	if cur < 5 * i:
		break
	cur -= 5 * i
	ans += 1
print(ans)


(n, k) = list(map(int, input().split()))
ans = 0
curr = 0
while curr + 5 * (ans + 1) + k <= 240:
	ans += 1
	curr += 5 * ans
print(min(n, ans))


(n, k) = list(map(int, input().split()))
t = (240 - k) / 5
for i in range(1, n + 1):
	if i * (i + 1) / 2 > t:
		i -= 1
		break
print(i)


(n, k) = map(int, input().split())
time = 4 * 60 - k
sm = 0
for i in range(1, 13):
	sm += i * 5
	if sm > time:
		ind = i - 1
		break
if ind > n:
	print(n)
else:
	print(ind)


def main():
	(n, k) = list(map(int, input().split()))
	time = 240 - k
	output = 0
	time -= (output + 1) * 5
	while time >= 0:
		output += 1
		time -= (output + 1) * 5
	print(min(output, n))
main()


(n, k) = (int(x) for x in input().split())
minutes = 4 * 60 - k

def num_solvable(n, k, minutes):
	for i in range(1, n + 1):
		minutes -= 5 * i
		if minutes < 0:
			return i - 1
	return n
print(num_solvable(n, k, minutes))


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
(n, m) = q()
print(len([i for i in range(1, n + 1) if sum(range(1, n + 1)[0:i]) * 5 <= 240 - m]))


(n, k) = input().split(' ')
n = int(n)
k = int(k)

def exp(n):
	return n * (n + 1) / 2
while n >= 0:
	if 5 * exp(n) <= 240 - k:
		break
	else:
		n = n - 1
print(n)


from math import ceil, log, floor, sqrt
import math

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def get_string(n):
	s = 'codeforces'
	l = []
	res = ''
	flag = True
	if n == 1:
		return s
	for i in range(10):
		l.append(1)
	m = 1
	while flag:
		for i in range(10):
			m = m * (l[i] + 1) // l[i]
			l[i] += 1
			if m >= n:
				flag = False
				break
	for i in range(10):
		for j in range(l[i]):
			res += s[i]
	return res

def nc2(n):
	return n * (n + 1) / 2

def get_grain_count(n, l, m):
	print(l, n - nc2(l) - (m + l + 1))
	return n - nc2(l) - (m + l + 1)

def count_days(n, m):
	if n == 1:
		return 1
	value = 2 * (n - m - 1)
	l = ceil((-3 + sqrt(9 + 4 * value)) / 2)
	while get_grain_count(n, l, m) > 0:
		l += 1
	return m + l + 1

def get_count(n, k):
	value = 240 - k
	for count in range(n, 0, -1):
		if 5 * nc2(count) <= value:
			return count
	return 0
t = 1
while t:
	t = t - 1
	(n, k) = map(int, input().split())
	print(get_count(n, k))


res = [int(n) for n in input().split()]
remtime = 240 - res[1]
count = 0
for i in range(res[0]):
	time = 5 * (i + 1)
	remtime = remtime - time
	if remtime >= 0:
		count = count + 1
print(count)


(m, n) = map(int, input().split())
p = 240 - n
i = 1
sum1 = 0
while p >= 0:
	p = p - 5 * i
	sum1 += 1
	i += 1
if sum1 > m:
	print(m)
else:
	print(sum1 - 1)


(n, k) = [int(x) for x in input().split()]
time = 240 - k
i = 1
rez = 0
while time >= i * 5 and i <= n:
	time -= i * 5
	rez += 1
	i += 1
print(rez)


(n, k) = map(int, input().split())
time = 240 - k
summ = 0
for i in range(n):
	if summ > time:
		print(i - 1)
		exit()
	summ += 5 * (i + 1)
if summ > time:
	print(n - 1)
else:
	print(n)


(n, ttg) = map(int, input().split())
ttp = 240
l1 = []
for i in range(1, n + 1):
	l1.append(i * 5)
s1 = sum(l1)
tt = s1 + ttg
if tt <= ttp:
	print(n)
else:
	t = tt - ttp
	et = s1 - t
	count = 0
	s2 = 0
	for i in l1:
		s2 += i
		if s2 <= et:
			count += 1
		else:
			break
	print(count)


(n, k) = map(int, input().split())
l = 240 - k
i = 1
while l >= 0:
	l = l - 5 * i
	i = i + 1
print(min(i - 2, n))


t = 240
(n, k) = map(int, input().split())
rest = t - k
i = 0
s = 0
while rest > 0:
	i += 1
	s = rest % (5 * i)
	rest -= 5 * i
if s != 0:
	i -= 1
print(min(i, n))


[n, k] = [int(x) for x in input().split(' ')]
lower = 0
upper = n
mid = (upper + lower) // 2
while upper > lower:
	requiredTime = 5 * (mid * (1 + mid) / 2)
	if 240 - requiredTime == k:
		break
	elif 240 - requiredTime > k:
		lower = mid
	else:
		upper = mid
	if upper - lower == 1:
		requiredTime = 5 * (upper * (1 + upper) / 2)
		if 240 - requiredTime >= k:
			mid = upper
		else:
			mid = lower
		break
	else:
		mid = (upper + lower) // 2
print(mid)


(n, k) = [int(x) for x in input().split()]
time = 240 - k
t = 5 * n * (n + 1) / 2
while t > time:
	n -= 1
	t = 5 * n * (n + 1) / 2
print(n)


n = input()
l = map(int, n.split())
main = list(l)
prb = main[0]
k = main[1]
total_time = 240
rem = total_time - k
sol = 0
time = 0
i = 1
while True:
	req = 5 * i
	time += req
	if i > prb or time > rem:
		break
	else:
		sol += 1
	i += 1
print(sol)


import sys
import math
import bisect

def main():
	(n, k) = map(int, input().split())
	A = [0] * n
	for i in range(n):
		A[i] = (i + 1) * 5
		if i:
			A[i] += A[i - 1]
	first = 0
	last = bisect.bisect_right(A, 240 - k)
	print(last - first)
main()


(n, m) = [int(x) for x in input().split()]
m = 240 - m
m = m // 5
m = (m * 8 + 1) ** (1 / 2)
m = m - 1
m = int(m / 2)
if m > n:
	m = n
print(m)


(n, k) = input().split()
n = int(n)
k = int(k)
t = 240 - k
summa = 0
i = 1
while summa <= t:
	summa += i * 5
	i += 1
if i - 2 <= n:
	print(i - 2)
else:
	print(n)


def main():
	from sys import stdin, stdout
	import math
	(n, k) = map(int, stdin.readline().split())
	rm = (240 - k) // 5
	ans = (-1 + math.sqrt(1 + 8 * rm)) // 2
	stdout.write(str(min(int(ans), n)))
main()


(problems, timeNeeded) = [int(a) for a in input().split()]
timeLeft = 240 - timeNeeded
counter = 0
for numb in range(1, problems + 1):
	if timeLeft - numb * 5 >= 0:
		timeLeft -= numb * 5
		counter += 1
	else:
		break
print(counter)


(n, k) = map(int, input().split(' '))
completedTime = 0
counte = 0
remainingTime = 240 - k
for i in range(1, n + 1):
	completedTime += 5 * i
	if completedTime <= remainingTime:
		counte += 1
	else:
		break
print(counte)


(n, k) = map(int, input().split())
k = 240 - k
i = 0
count = 0
j = 1
while i <= k:
	i += 5 * j
	j += 1
	if i <= k:
		count += 1
if count >= n:
	print(n)
else:
	print(count)


(p, t) = input().split()
p = int(p)
t = int(t)
min_t = 240 - t
sum_p = 5 * p * (1 + p) / 2
while sum_p > min_t:
	p = p - 1
	sum_p = 5 * p * (1 + p) / 2
print(p)


(n, k) = map(int, input().split())
remaining = (240 - k) * 2 // 5
p = 1
while remaining >= p * (p + 1):
	p += 1
print(min(p - 1, n))


(n, m) = map(int, input().split())
z = 240 - m
for i in range(1, n + 1):
	if i * 5 > z:
		print(i - 1)
		exit()
	z -= i * 5
print(n)


(n, k) = map(int, input().split())
time = 4 * 60 - k
if time <= 4:
	print(0)
	exit()
arr = [i * 5 for i in range(1, n + 1)]
count = 0
i = 0
while time - arr[i] >= 0:
	time -= arr[i]
	i += 1
	count += 1
	if i == n:
		break
print(count)


(n, k) = list(map(int, input().split()))
time = 240 - k
ans = 0
for i in range(1, n + 1):
	if 5 * i <= time:
		ans += 1
		time -= 5 * i
print(ans)


(n, k) = [int(x) for x in input().split()]
while 1:
	if k + 5 * n * (n + 1) / 2 <= 240:
		break
	n = n - 1
print(n)


import math
(n, k) = [int(x) for x in input().split()]
print(min(n, int(math.floor(math.sqrt((1925 - 8 * k) / 5) - 1) / 2)))


(n, k) = map(int, input().split())
k = 240 - k
left = 0
right = 11
while left + 1 < right:
	middle = (left + right) // 2
	ans = 0
	for i in range(1, middle + 1):
		ans += i * 5
	if ans > k:
		right = middle
	else:
		left = middle
if left > n:
	print(n)
else:
	print(left)


import math
sqrt = math.sqrt

def main():
	(n, m) = map(int, input().split())
	m = 240 - m
	print(int(min((sqrt(25 + 40 * m) - 5) // 10, n)))
main()


(n, t) = list(map(int, input().split(' ')))
min = 0
hrs = 20
min = min + t % 60
hrs = hrs + t // 60
i = 1
c = 0
while i <= n and hrs <= 23:
	k = i * 5
	min = min + k
	if min > 59:
		temp = min
		min = temp % 60
		hrs = hrs + temp // 60
	elif min == 60:
		min = 0
		hrs = hrs + 1
	if hrs <= 23:
		c = c + 1
	elif hrs == 24 and min == 0:
		c = c + 1
	else:
		break
	i += 1
print(c)


(n, b) = map(int, input().split())
rem = 240 - b
c = 0
time = 0
for i in range(1, n + 1):
	t = 5 * i
	time = time + t
	if rem >= time:
		c = c + 1
print(c)


(n, k) = map(int, input().split())
c = 240 - k

def k(r):
	return 5 * (r * (r + 1) // 2)

def f(l, r):
	m = (l + r + 1) // 2
	while r - l > 0:
		if k(m) > c:
			r = m - 1
		elif k(m) < c:
			l = m
		else:
			return m
		m = (l + r + 1) // 2
	return l
print(f(0, n))


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

def LI():
	return list(map(int, inp().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in inp().strip().split()]

def LF():
	return [float(x) for x in inp().strip().split()]

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

def S():
	return inp().strip()

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	(n, k) = MI()
	tt = 240
	s = []
	for i in range(n):
		s.append(5 * (i + 1))
	while True:
		x = sum(s)
		if x + k <= tt:
			pf(str(len(s)))
			break
		else:
			s.pop()
main()


def can(x, k):
	return x * (x + 1) / 2 * 5 <= 240 - k

def bin(n, k):
	lo = 0
	hi = n + 1
	while lo < hi:
		mid = (lo + hi) // 2
		if not can(mid, k):
			hi = mid
		else:
			lo = mid + 1
	return lo - 1
(n, k) = map(int, input().split())
print(bin(n, k))


R = lambda : map(int, input().split())
(n, l) = R()
while 5 * (n + 1) * n / 2 > 240 - l:
	n -= 1
print(n)


(n, t) = input().split()
(n, t) = (int(n), int(t))
total = 240 - t
cnt = 0
ti = 0
for i in range(1, 11):
	ti += i * 5
	if ti > total or i > n:
		break
	cnt += 1
print(cnt)


(n, k) = map(int, input().split())
s = 0
q = 0
k = 240 - k
for i in range(1, n + 1):
	s += i * 5
	if s > k:
		break
	q += 1
print(str(q), end='')


(n, k) = [int(x) for x in input().split()]
total = 240 - k
ctr = 0
s = 0
for i in range(n):
	s += 5 * (i + 1)
	if s <= total:
		ctr += 1
print(ctr)


(n, k) = [int(x) for x in input().split()]
l = 240 - k
p = 0
ans = 0
for x in range(1, n + 1):
	p += 5 * x
	if p > l:
		break
	ans += 1
print(ans)


(n, m) = map(int, input().split())
t1 = 240 - m
c = 0
i = 1
count = 0
while c <= t1:
	c = c + i * 5
	if c > t1:
		break
	i = i + 1
	count = count + 1
ans = min(count, n)
print(ans)


[n, k] = [int(x) for x in input().split(' ')]
num = 1
time = k + 5
while time <= 240 and num <= n:
	num += 1
	time += 5 * num
print(num - 1)


time = 0
(x, y) = [int(j) for j in input().split()]
for i in range(1, x + 1):
	time += 5 * i
while time + y > 240:
	time -= 5 * x
	x -= 1
print(x)


TOTAL_TIME = 4 * 60
const_time = 5
(n, k) = list(map(int, input().split()))
total = 0
if 5 > TOTAL_TIME - k:
	print(0)
else:
	for i in range(1, n + 1):
		total += 5 * i
		if total + 5 * (i + 1) > TOTAL_TIME - k:
			break
	print(i)


(n, k) = map(int, input().split())
total_mins = 240
remaining_mins = total_mins - k
count = 0
for i in range(1, n + 1):
	i *= 5
	remaining_mins -= i
	if remaining_mins > 0 or remaining_mins == 0:
		count += 1
	else:
		break
print(count)


(n, k) = input().split()
n = eval(n)
time = 240
time -= eval(k)
for i in range(n, -1, -1):
	ans = n * (n + 1) // 2 * 5
	if ans <= time:
		break
	n -= 1
print(n)


(q, time_to_home) = [int(x) for x in input().split()]
tasks_temp = sum([i * 5 for i in range(1, q + 1)])
time_left = 240 - time_to_home
result = 0
z = 0
for i in range(1, q + 1):
	result = result + 5 * i
	z += 1
	if result > time_left:
		z -= 1
		break
print(z)


(x, y) = map(int, input().split())
v = 0
s = 5
sum = 0
for i in range(x):
	if i * s + y + sum <= 240:
		v = v + 1
		sum = sum + i * s
if v * 5 + sum + y > 240:
	v = v - 1
print(v)


n = list(map(int, input().split()))
ans = 0
x = 240 - n[1]
for i in range(1, n[0] + 1):
	a = 5 * i
	x = x - a
	if x < 0:
		break
	ans = ans + 1
print(ans)


(n, k) = map(int, input().split())
i = 1
S = 240 - k
while S > 0 and i <= n:
	S = S - i * 5
	i = i + 1
if S < 0:
	print(i - 2)
else:
	print(i - 1)


inp = input()
inp = inp.strip().split()
(n, k) = (int(inp[0]), int(inp[1]))
time_all = 240
have_time = 240 - k
tmp = 0
count = 0
for task in range(1, n + 1):
	tmp += task * 5
	if tmp <= have_time:
		count += 1
	else:
		break
print(count)


(a, b) = map(int, input().split())
b = 60 * 4 - b
while 5 * (a + 1) * a / 2 > b:
	a -= 1
print(a)


s = 0
string = input()
numbers = string.split()
n = int(numbers[0])
k = int(numbers[1])
k = 240 - k
for i in range(n):
	if 5 * (i + 1) <= k:
		s += 1
		k -= 5 * (i + 1)
	else:
		break
print(s)


(n, k) = map(int, input().split())
k = 240 - k
solved = 0
for i in range(1, n + 1):
	if k >= 5 * i:
		solved += 1
	k -= 5 * i
print(solved)


(n, t) = list(map(int, input().split()))
x = 240 - t
c = 0
i = 1
while True:
	if i > n or x - 5 * i < 0:
		break
	c += 1
	x -= 5 * i
	i += 1
print(c)


(n, k) = list(map(int, input().split()))
time = 240
counter = 0
summ = 0
while counter < n:
	if k + 5 * (counter + 1) + summ <= 240:
		counter += 1
		summ += 5 * counter
	else:
		break
print(counter)


(n, k) = map(int, input().split())
time = 240
time_present = 240 - k
time_required = count = 0
for i in range(1, n + 1):
	time_required += 5 * i
	if time_required <= time_present:
		count += 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
cn = 0
t = 240 - k
cn1 = 0
for i in range(1, n + 1):
	if cn + 5 * i <= t:
		cn += 5 * i
	else:
		cn1 = i - 1
		break
else:
	cn1 = n
print(cn1)


(p, q) = map(int, input().split())
z = 240 - q
i = 1
t = 0
while i <= p:
	t += i * 5
	if t > z:
		break
	i += 1
print(i - 1)


def solve(arr):
	ans = 0
	have_to_without_travel = 60 * 4 - arr[1]
	if have_to_without_travel <= 0:
		return 0
	else:
		for i in range(1, arr[0] + 1):
			k = i * 5
			if have_to_without_travel - k >= 0:
				have_to_without_travel -= k
				ans += 1
	return ans
print(solve(list(map(int, input().split(' ')))))


(n, k) = map(int, input().split())
hour = 240
final = hour - k
s = 1
count = 0
total = 0
while n:
	total += 5 * s
	if total <= final:
		count += 1
	else:
		break
	n -= 1
	s += 1
print(count)


def go(n, k):
	timeLeft = 240 - k
	probNum = 1
	while True:
		timeLeft -= 5 * probNum
		if timeLeft >= 0:
			probNum += 1
		else:
			break
	return min(probNum - 1, n)
(n, k) = list(map(int, input().split()))
print(go(n, k))


def func(l1, key):
	ans = -1
	start = 0
	end = len(l1) - 1
	if l1[-1] < key:
		return len(l1)
	elif l1[0] > key:
		return 0
	while start <= end:
		mid = start + (end - start) // 2
		if l1[mid] == key:
			ans = mid
			break
		elif l1[mid] < key:
			start = mid + 1
			ans = mid
		else:
			end = mid - 1
	return ans + 1
(n, k) = map(int, input().split())
l1 = [5]
for i in range(2, n + 1):
	l1.append(5 * i + l1[i - 2])
key = 240 - k
print(func(l1, key))


(n, k) = map(int, input().split())
b = 0
x = 0
while 240 - (k + (x + (b + 1) * 5)) >= 0 and n > 0:
	b += 1
	x = x + b * 5
	n -= 1
print(b)


(a, b) = [int(i) for i in input().split()]
c = 240 - b
e = 0
d = 0
for i in range(1, 11):
	d = d + 5 * i
	if d <= c:
		pass
	else:
		e = i - 1
		break
if e > a:
	print(a)
else:
	print(e)


minutes_for_problems = 4 * 60
(problems_available, time_to_party) = [int(x) for x in input().split(' ')]
minutes_for_problems -= time_to_party
problems_solved = 0
for problem in range(1, problems_available + 1):
	if minutes_for_problems - problem * 5 >= 0:
		minutes_for_problems -= problem * 5
		problems_solved += 1
	else:
		break
print(problems_solved)


(x, t) = [int(i) for i in input().split()]
t = 240 - t
n = 0
while 2 * t / 5 >= n ** 2 + n:
	n += 1
n -= 1
print(min(n, x))


(n, k) = [int(i) for i in input().split()]
x = 240 - k
i = 1
c = 0
while x:
	x -= 5 * i
	if x >= 0 and i <= n:
		c += 1
	else:
		break
	i += 1
print(c)


(n, k) = map(int, input().split())
time = [5 * (i + 1) for i in range(n)]
sum_arr = [sum(time[:i + 1]) for i in range(n)]
y = 240 - k

def Search(sum_arr, x):
	l = 0
	r = n - 1
	if x < sum_arr[l]:
		return -1
	while l <= r:
		mid = l + (r - l) // 2
		if sum_arr[mid] == x:
			return mid
		elif x < sum_arr[mid]:
			r = mid - 1
		else:
			l = mid + 1
			ans = mid
	return ans
x = Search(sum_arr, y)
print(x + 1)


class CodeforcesTask750ASolution:

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

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

	def process_task(self):
		time = 240 - self.n_k[1]
		i = 1
		solved = 0
		while time - i * 5 >= 0 and i <= self.n_k[0]:
			solved += 1
			time -= i * 5
			i += 1
		self.result = str(solved)

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


(n, k) = map(int, input().split())
rem = 240 - k
req = 0
for i in range(n):
	req += (i + 1) * 5
	if req > rem:
		break
if req > rem:
	print(i)
else:
	print(n)


(n, m) = map(int, input().split())
time = []
for i in range(1, n + 1):
	time.append(i * 5)
while sum(time) + m > 240:
	time.pop()
else:
	print(len(time))


import collections

def read():
	return input().strip()

def readInt():
	return int(input().strip())

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

def solve(n, k):
	totalAvailableMins = 4 * 60
	timeAvailableMin = totalAvailableMins - k
	ans = 0
	for i in range(1, n + 1):
		if timeAvailableMin >= i * 5:
			timeAvailableMin -= i * 5
			ans += 1
	return ans
[n, k] = readList()
print(solve(n, k))


h = list(map(int, input().split()))
n = h[0]
m = h[1]
z = 240 - m
i = 5
t = 2
count = 0
while z >= i and t - 1 <= n:
	z = z - i
	i = 5 * t
	count += 1
	t += 1
print(count)


def solution(n, k):
	time = 240 - k
	count = 0
	for i in range(0, n):
		prob = 5 * (i + 1)
		if time - prob >= 0:
			count = count + 1
			time = time - prob
		else:
			break
	return count

def main():
	(n, k) = map(int, input().split())
	ans = solution(n, k)
	print(ans)
main()


a = input()
a = a.split()
b = int(a[1])
a = int(a[0])
sum = 0
n = a
for i in range(a):
	sum += 5 * (i + 1)
	if 240 - sum - b < 0:
		n = i
		break
print(n)


(m, k) = input().split(' ')
m = int(m)
k = int(k)
t = (240 - k) // 5 * 2
if (1 + m) * m <= t:
	r = m
else:
	i = 1
	while i <= m:
		if i * (i + 1) > t:
			r = i - 1
			i = m + 1
		i += 1
print(r)


import math as m
[n, k] = [int(x) for x in input().split()]
print(min(m.floor((m.sqrt(385 - 8 * k / 5) - 1) / 2), n))


(n, k) = input().split()
n = int(n) + 1
k = int(k)
sum = 0
c = 0
for i in range(1, n):
	sum = sum + i * 5
	s = sum + k
	if s <= 240:
		c += 1
	else:
		break
print(c)


n_k = [int(i) for i in input().split(' ')]
n = n_k[0]
k = n_k[1]
time_for_problems = 240 - k
time = 0
answered = 0
n_question = 1
while time <= time_for_problems - 5 * n_question and answered < n:
	time += 5 * n_question
	n_question += 1
	answered += 1
print(answered)


case = input().split()
n = int(case[0])
k = int(case[1])
t = 5
tr = 240
for i in range(1, n + 1):
	if tr - t - k >= 0:
		tr = tr - t
		t += 5
	else:
		print(i - 1)
		break
if t == 5 * (n + 1):
	print(n)


(n, k) = map(int, input().split())
problems = [5 * i for i in range(1, n + 1)]
revproblems = problems[::-1]
number = [i for i in range(len(problems)) if sum(revproblems[i:]) + k > 240]
print(len(problems) - len(number))


(n, k) = input().split()
n = int(n)
k = 240 - int(k)
for i in range(1, n + 1):
	a = i * 5
	if k >= a:
		k = k - a
	else:
		print(i - 1)
		exit()
print(n)


(n, k) = map(int, input().split())
x = 240 - k
i = 1
sum = 0
j = 0
while sum + i * 5 <= x:
	sum += i * 5
	i += 1
	j += 1
print(min(j, n))


nums = [int(i) for i in input().split()]
nProbs = nums[0]
travelTime = nums[1]
AvailableTime = 4 * 60 - travelTime
sum = 0
for i in range(1, nProbs + 1):
	sum += i
	if sum * 5 > AvailableTime:
		print(i - 1)
		exit()
if AvailableTime > 0:
	print(nProbs)
	exit()
print(0)


from collections import defaultdict
import sys, os, math
(n, k) = map(int, input().split())
ans = 1
while ans * (ans + 1) * 5 <= (240 - k) * 2:
	ans += 1
print(min(ans - 1, n))


ALL_TIME = 240

def _time_free(k):
	return ALL_TIME - k

def _time_left(tl, tt):
	return tl - tt

def _task_time(i):
	return i * 5

def done_tasks(n, k):
	time_left = _time_free(k)
	count_tasks = 0
	for i in range(1, n + 1):
		task_time = _task_time(i)
		if time_left >= task_time:
			time_left = _time_left(time_left, task_time)
			count_tasks += 1
		else:
			return count_tasks
	return count_tasks

def main():
	(n, k) = map(int, input().split())
	print(done_tasks(n, k))
main()


x = input().split()
a = int(x[0])
b = int(x[1])
t = 240
p = []
while a != 0:
	c = a * 5
	p.append(c)
	p = sorted(p)
	a -= 1
su = sum(p) + b
a1 = int(x[0])
while su > t:
	p.remove(p[-1])
	su = sum(p) + b
	a1 -= 1
print(a1)


(a, b) = [int(i) for i in input().split(' ')]
t = 240 - b
t1 = 0
for i in range(a + 1):
	t1 += 5 * i
	if t1 > t:
		print(i - 1)
		break
	elif i == a:
		print(i)


import os
import sys
has_time = 4 * 60

def findNumTask(n, time):
	i = 0
	leftTime = has_time
	while leftTime >= time and n - i >= 0:
		i += 1
		leftTime -= i * 5
	return i - 1
args = input().split()
n = int(args[0])
time = int(args[1])
print(findNumTask(n, time))


arr = [5]
(n, k) = map(int, input().split())
for i in range(1, n):
	arr.append((i + 1) * 5 + arr[i - 1])
maxt = 240
remt = maxt - k
ans = 0
for i in range(0, len(arr)):
	if arr[i] <= remt:
		ans = i + 1
	else:
		break
print(ans)


def get_line():
	return [int(x) for x in input().split()]
(n, k) = get_line()
timeLimit = 240
timeLimit -= k
time_for_contest = 0
for num in range(1, n + 1):
	time_for_contest += num * 5
	if time_for_contest > timeLimit:
		n = num - 1
		break
print(n)


(n, k) = map(int, input().split())
t = 240 - k
p = 0
while t > 0 and p < n:
	p += 1
	t -= p * 5
print(p if t >= 0 else p - 1)


from math import sqrt, floor
n_k = list(map(int, input().split()))
n = n_k[0]
k = n_k[1]
if 240 - k >= 2.5 * (n * n + n):
	print(n)
else:
	print(floor((sqrt(9625 - 40 * k) - 5) / 10))


(n, k) = [int(x) for x in input().split()]
mins = 240
count = 0
time = 0
for i in range(1, n + 1):
	if time + 5 * i <= mins - k:
		count += 1
		time += 5 * i
print(count)


(n, k) = map(int, input().split())
t = 240 - k
i = 0
summa = 0
while i <= n - 1 and summa <= t:
	i += 1
	taskTime = i * 5
	summa += taskTime
if summa > t:
	print(i - 1)
else:
	print(i)


(n, k) = map(int, input().split())
tr = 240 - k
ans = 0
mycnd = True
for i in range(1, n + 1):
	ans += 5 * i
	if ans > tr:
		print(str(i - 1))
		mycnd = False
		break
if mycnd:
	print(n)


(counter, solution, i) = (5, 0, 0)
(z1, z2) = map(int, input().split())
result = 240 - z2
while i < z1:
	if counter <= result:
		result -= counter
		counter += 5
		solution += 1
	if counter > result:
		break
	i += 1
print(solution)


def Main():
	(n, k) = map(int, input().split())
	l = 0
	r = n
	while l < r:
		mid = (l + r + 1) // 2
		if k + 5 * (mid * (mid + 1) // 2) <= 240:
			l = mid
		else:
			r = mid - 1
	print(l)
Main()


(n, m) = map(int, input().split())
ost = 240 - m
i = 1
while ost >= 5 * i and i <= n:
	ost = ost - 5 * i
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
k = abs(k - 240)
solution = 0
for i in range(1, n + 1):
	if k - i * 5 >= 0:
		k -= i * 5
		solution += 1
	else:
		break
print(solution)


def test():
	(n, k) = map(int, input().split(' '))
	tm = 1200 + k
	sp = 0
	for i in range(n):
		tm += (i + 1) * 5
		if tm <= 1440:
			sp += 1
	print(sp)
test()


(n, k) = map(int, input().split())
c = k
d = 0
while c < 240:
	d = d + 1
	c = c + d * 5
	if c > 240 or d > n:
		d = d - 1
print(d)


(n, m) = map(int, input().split())
time = 240 - m
ans = 0
while time - 5 * ans >= 5 * (ans + 1):
	time -= 5 * ans
	ans += 1
if ans > n:
	print(n)
else:
	print(ans)


(n, k) = map(int, input().split())
x = 240
s = k
c = 0
f = 0
if k >= x:
	print(0)
else:
	for i in range(1, n + 1):
		s = s + 5 * i
		if s > x:
			f = 1
			print(c)
			break
		else:
			c = c + 1
		if f == 1:
			break
	if f == 0:
		print(n)


a = list(map(int, input().split()))
x = 240 - a[1]
c = 0
s = 0
for i in range(1, a[0] + 1):
	s = s + 5 * i
	if s > x:
		break
	c = c + 1
print(c)


(n, k) = [int(i) for i in input().split(' ')]
time_list = [5, 15, 30, 50, 75, 105, 140, 180, 225]
print(0) if 240 - k < 5 else print(min(time_list.index(max((i for i in time_list if i <= 240 - k))) + 1, n))


(n, k) = map(int, input().split())
y = 240 - k
o = 0
t = 0
for i in range(1, n + 1):
	o += 5 * i
	if o <= y:
		t += 1
	else:
		break
print(t)


def Logic(element):
	res = 0
	for ele in range(element + 1):
		res += ele * 5
	return res

def BinarySearch(arr, start, end, k):
	res = 0
	while start <= end:
		mid = (start + end) // 2
		if Logic(arr[mid]) + k <= 240:
			res = arr[mid]
			start = mid + 1
		else:
			end = mid - 1
	return res
(n, k) = map(int, input().split())
arr = list()
for i in range(n + 1):
	arr.append(i)
start = 0
end = n
output = BinarySearch(arr, start, end, k)
print(output)


import math
(n, k) = map(int, input().split())
k = 240 - k
i = 1
while k >= 5 * i:
	k -= 5 * i
	i += 1
print(min(n, i - 1))


def maxproblems(n: int, k: int) -> int:
	prob_count = 0
	prob_total_time = 0
	for i in range(1, n + 1):
		prob_total_time = prob_total_time + 5 * i
		if prob_total_time + k <= 240:
			prob_count += 1
		else:
			break
	return prob_count

def main():
	(n, k) = map(int, input().split())
	print(maxproblems(n, k))
main()


maxi = [int(x) for x in input().split()]
a = 1
summ = 0
count = 0
while summ <= 240 - maxi[1] and a <= maxi[0]:
	summ = summ + a * 5
	if summ <= 240 - maxi[1]:
		count += 1
	a += 1
print(count)


(a, b) = map(int, input().split(' '))
sum1 = 0
k = 0
for i in range(1, a + 1):
	sum1 += 5 * i
	if b + sum1 <= 240:
		continue
	else:
		k = 1
		break
if k == 1:
	print(i - 1)
elif k == 0:
	print(i)


(n, k) = map(int, input().split())
a = 240 - k
x = 0
y = 0
for i in range(1, n + 1):
	x += i * 5
	if x <= a:
		y += 1
print(y)


(n, k) = map(int, input().split())
i = 0
b = 0
a = 240 - k
count = 0
while i < a and count < n:
	count = count + 1
	b = b + 5
	i = i + b
	if i > a or count > n:
		count = count - 1
print(count)


arr = [0, 5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
(n, k) = map(int, input().split())
total = 240
available = total - k
for i in reversed(arr):
	if available >= i:
		k = arr.index(i)
		if k <= n:
			print(k)
			break


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

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

def li():
	return list(mi())
(n, k) = mi()
l = 240 - k
ans = 0
for i in range(1, n + 1):
	if i * (i + 1) // 2 * 5 <= l:
		ans = i
	else:
		break
print(ans)


(prob_num, time) = input().split(' ')
prob_num = int(prob_num)
time = int(time)
ls = []
t_time = 240 - time
for i in range(1, prob_num + 1):
	ls.append(i * 5)
count = 0
tem = 0
for i in range(len(ls)):
	tem += ls[i]
	if tem <= t_time:
		count += 1
print(count)


l = list(map(int, input().strip().split()))
n = l[0]
k = l[1]
a = 240 - k
count = 0
i = 1
while a >= i * 5 and i <= n:
	a = a - i * 5
	i = i + 1
	count = count + 1
print(count)


(n, k) = map(int, input().split())
i = 1
vrem9 = 5
while 240 - vrem9 >= k:
	i += 1
	vrem9 += i * 5
print(min(n, i - 1))


(n, k) = map(int, input().split())
tempo = 240 - k
qtd = 0
i = 1
for i in range(1, n + 1):
	gasto = 5 * i
	tempo -= gasto
	if tempo >= 0:
		qtd += 1
print(qtd)


def problems_limit(limit_time):
	numbers_of_problems = 0
	total_time = 0
	while True:
		numbers_of_problems += 1
		total_time += 5 * numbers_of_problems
		if total_time > limit_time:
			return numbers_of_problems - 1

def answers_problems(pro_in_contest, travel_time):
	time_to_solve = 240 - travel_time
	problems = problems_limit(time_to_solve)
	if problems <= pro_in_contest:
		return problems
	else:
		return pro_in_contest
inp = input()
(prob, time) = inp.split(' ')
print(answers_problems(int(prob), int(time)))


(n, k) = [int(x) for x in input().split(' ')]
(limit, mustGo, i, questionTime) = (240, 240 - k, 1, 0)
while True:
	questionTime += 5 * i
	if questionTime <= mustGo:
		if questionTime + 5 * i <= mustGo and i < n:
			i += 1
			continue
		else:
			print(i)
			break
	else:
		print(i - 1)
		break


import math
from collections import Counter

def get(f):
	return map(f, input().split())

def main():
	(n, k) = get(int)
	left = 240 - k

	def s(i):
		return math.floor((10 + 5 * (i - 1)) / 2 * i)
	for i in range(1, n + 1):
		ss = s(i)
		if s(i) > left:
			print(i - 1)
			return
	print(n)
main()


(n, k) = map(int, input().split())
z = 240 - k
i = 1
t = 0
while i != n + 1:
	t = t + 5 * i
	i += 1
i = 0
o = 0
if t < 5:
	print(0)
elif z >= t:
	print(n)
else:
	while o <= z:
		i += 1
		o = o + 5 * i
	print(i - 1)


(n, k) = map(int, input().split())
test_minutes = 240 - k
numQuestions = 0
while test_minutes >= 0 and numQuestions <= n:
	test_minutes -= (numQuestions + 1) * 5
	numQuestions += 1
print(numQuestions - 1)


(n, k) = map(int, input().split())
timeTotal = 240 - k
timeSolve = [5 * (i + 1) for i in range(n)]
index = 0
while timeTotal >= 0 and index < len(timeSolve):
	timeTotal -= timeSolve[index]
	if timeTotal < 0:
		break
	index += 1
print(index)


(n, k) = map(int, input().split())
a = 240 - k
ans = 0
for f in range(1, n + 1):
	a -= f * 5
	if a < 0:
		break
	else:
		ans = f
print(ans)


data = input().split()
Q = int(data[0])
D = int(data[1])
timeleft = 240 - D
count = 0
while timeleft > 0:
	if Q <= 0:
		break
	for x in range(1, Q + 1):
		timeleft = timeleft - 5 * x
		if timeleft < 0:
			break
		Q -= 1
		count += 1
print(count)


def main():
	(n, m) = [int(v) for v in input().split()]
	e = 4 * 60 - m
	d = 0
	i = 1
	while d <= e:
		d += 5 * i
		if d > e:
			break
		i += 1
	print(min(n, i - 1))
main()


import math
import itertools
gh = lambda : map(int, input().split())
mod = 998244353
mod = int(mod)

def main():
	(n, k) = gh()
	cnt = 240 - k
	i = 0
	while cnt >= (i + 1) * 5 and i <= n:
		i += 1
		cnt -= 5 * i
	print(i - (i > n))
main()


(n, k) = map(int, input().split())
c = 240 - k
d = 0
i = 0
while d <= c:
	i += 1
	d += 5 * i
print(min(n, i - 1))


sysIn = list(map(int, input().split()))
n = sysIn[0]
remainingTime = 240 - sysIn[1]
totalSum = remainingTime // 5
spent = 0
if (1 + n) * n // 2 <= totalSum:
	print(n)
else:
	for i in range(1, n + 1):
		if spent + i <= totalSum:
			spent += i
		else:
			print(i - 1)
			break


import sys
numbers = [int(i) for i in sys.stdin.readline().split()]
n = numbers[0]
k = numbers[1]
match_time = 240
time_to_solve = match_time - k
solved_tasks = 0
i = 1
while i <= n:
	if 5 * i <= time_to_solve:
		solved_tasks += 1
		time_to_solve -= 5 * i
	else:
		break
	i += 1
print(solved_tasks)


import math

def main():
	(n, k) = map(int, input().split(' '))
	mins_available = 240 - k
	if k >= 236 or n == 0:
		print('0')
		exit()
	elif tot_time(n) <= mins_available:
		print(n)
		exit()
	print(strictly_greater(n, mins_available))

def tot_time(n):
	return n * (n + 1) // 2 * 5

def strictly_greater(n, mins_available):
	l = 1
	r = n
	ans = 0
	while l <= r:
		mid = math.floor((l + r) / 2)
		if tot_time(mid) > mins_available:
			ans = mid
			r = mid - 1
		else:
			l = mid + 1
	return ans - 1
main()


(n, k) = map(int, input().split())
tt = 240
tt -= k
q = 0
t = 0
for i in range(1, n + 1):
	t = t + 5 * i
	if t <= tt:
		q += 1
	else:
		break
print(q)


(n, k) = map(int, input().split())
time = 5 + k
sm = 0
while time <= 240 and sm < n:
	sm += 1
	time += 5 * (sm + 1)
print(sm)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, k) = LI()
	r = 0
	t = 240 - k
	for i in range(n):
		if (i + 1) * 5 > t:
			break
		r = i + 1
		t -= (i + 1) * 5
	return r
print(main())


(n, k) = map(int, input().split())
maxi = 24 * 60 - (20 * 60 + k)
ans = 0
for i in range(1, n + 1):
	if i * 5 <= maxi:
		ans += 1
		maxi -= i * 5
print(ans)


(n, k) = map(int, input().split())
a = [5 * i * (i + 1) // 2 for i in range(1, n + 1)]
rm = 240 - k
ans = 0
l = 0
r = n - 1
while l <= r:
	m = l + (r - l) // 2
	if a[m] == rm:
		ans = m + 1
		break
	elif a[m] > rm:
		r = m - 1
	else:
		ans = m + 1
		l = m + 1
print(ans)


from math import sqrt
(n, k) = map(int, input().split())
c = -2 * ((240 - k) // 5)
print(min(int((sqrt(1 - 4 * c) - 1) // 2), n))


input = [int(i) for i in input().split()]
mins = 4 * 60 - input[1]
total_time = 0
for a in range(1, input[0] + 1):
	total_time += a * 5
	if total_time > mins:
		print(a - 1)
		break
	elif a == input[0]:
		print(a)


(n, k) = map(int, input().split())
t = 240 - k
i = 1
while t >= 5 * i:
	t -= 5 * i
	i += 1
print(i - 1) if i <= n else print(n)


(a, b) = input().split()
a = int(a)
b = int(b)
t = 240 - b
i = 0
while t >= 0:
	i += 1
	t -= 5 * i
print(min(i - 1, a))


import math
read = input()
input = read.split()
problems = int(input[0])
minutes = int(input[1])
time = 240 - minutes
out = int((-1 + math.sqrt(1 + 4 * 1 * (2 * time / 5))) // 2)
if out > problems:
	out = problems
print(out)


(n, k) = map(int, input().split())
t = 240 - k
nex = 1
time = 0
cur = 0
while nex <= n and time + nex * 5 <= t:
	cur += 1
	time += nex * 5
	nex += 1
print(cur)


(n, k) = input().split()
t = 240 - int(k)
x = 0
for i in range(1, 10 ** 9):
	x = x + 5 * i
	if x > t:
		print(i - 1)
		break
	elif i > int(n):
		print(i - 1)
		break


(n, k) = map(int, input().split())
t = 4 * 60 - k
tz = 0
i = 1
for j in range(n):
	tz += i * 5
	if tz > t:
		break
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
t = 0
limit = 240 - k
for res in range(1, n + 1):
	t += res * 5
	if t > limit:
		print(res - 1)
		exit(0)
print(res)


a = input().split()
k = int(a[1])
n = int(a[0])
l = 0
r = n + 1
while r - l > 1:
	mid = (l + r) // 2
	if 5 * mid * (mid + 1) // 2 > 240 - k:
		r = mid
	else:
		l = mid
print(l)


from typing import List

def parse_input() -> List[int]:
	return [int(x) for x in input().split()]

def solve(n: int, k: int) -> int:
	t = 240 - k
	for p in range(1, n + 1):
		if t >= 5 * p:
			t -= 5 * p
		else:
			return p - 1
	return n
(n, k) = parse_input()
print(solve(n, k))


def solve():
	(n, k) = [int(s) for s in input().split()]
	t = 24 * 60
	t -= k
	i = 5
	ans = 0
	while t - i >= 20 * 60 and n > 0:
		n -= 1
		t -= i
		i += 5
		ans += 1
	print(ans)
solve()


a = input()
a = a.split(' ')
x = int(a[0])
y = int(a[1])
t = 0
c = 0
for i in range(1, x + 1):
	t += 5 * i
	if t + y <= 240:
		c += 1
print(c)


(n, k) = map(int, input().split())
a = 5
b = []
c = 240
counter = 0
time = c - k
for i in range(1, n + 1):
	time -= i * 5
	if time >= 0:
		counter += 1
print(counter)


(n, k) = map(int, input().split())
a = 240
b = a - k
c = 0
d = []
for i in range(1, n + 1):
	c += 5 * i
	if b - c >= 0:
		d.append(i)
if len(d) == 0:
	d.append(0)
print(max(d))


(n, k) = map(int, input().split())
limit = 240
m = k
number = 1
st = 0
while m <= limit:
	ts = number * 5
	m = m + ts
	if m <= limit:
		number += 1
		st += 1
		if number <= n:
			continue
		else:
			break
	else:
		break
print(st)


n = input()
(n, k) = n.split(' ')
time = 4 * 60
time_left = time - int(k)
problem_solve = 0
for i in range(1, int(n) + 1):
	time_need = 5 * i
	if time_left - time_need < 0:
		break
	else:
		time_left -= time_need
		problem_solve += 1
print(problem_solve)


(n, k) = map(int, input().split())
t = (480 - 2 * k) // 5
i = 1
while i <= n and i * (i + 1) <= t:
	i += 1
print(i - 1)


n = input().split(' ')
t = int(n[0])
l = int(n[1])
num = 0
time = 240
count = 0
for i in range(1, t + 1):
	count += 5 * i
	num += 1
	if time - count >= l:
		continue
	else:
		num -= 1
		print(num)
		quit()
print(num)


(n, k) = map(int, input().split())
print(max([i for i in range(n + 1) if k + sum([5 * j for j in range(1, i + 1)]) <= 240]))


(n, k) = [int(i) for i in input().split()]
ans = 0
for i in range(1, n + 1):
	k += i * 5
	if 1440 >= 1200 + k:
		ans += 1
		continue
	else:
		break
print(ans)


import math
(n, k) = map(int, input().split())
t = 240 - k
x = min(n, math.floor((-5 + math.sqrt(25 + 4 * 2 * t * 5)) / 10))
print(x)


(n, k) = list(map(int, input().split()))
t = 240 - k
cur = 0
ans = 0
for i in range(1, n + 1):
	cur += i * 5
	if cur > t:
		break
	ans += 1
print(ans)


(k, t) = map(int, input().split())
ost = 4 * 60 - t
i = 0
while ost >= 0 and i <= k:
	i += 1
	ost -= 5 * i
print(i - 1)


(n, k) = (int(x) for x in input().split())
ans = 0
i = 1
while sum([x * 5 for x in range(1, i + 1)]) <= 240 - k and ans < n:
	ans += 1
	i += 1
print(ans)


(a, b) = map(int, input().split())
time = 20 * 60 + b
end = 24 * 60
count = 0
for i in range(1, a + 1):
	time += 5 * i
	count += 1
	if time > end:
		time -= 5 * i
		count -= 1
		break
	elif time == end:
		break
print(count)


(n, k) = map(int, input().split())
mins = 60 * 4 - k
solved = 0
for i in range(1, n + 1):
	t = 5 * i
	mins -= t
	if mins >= 0:
		solved += 1
	else:
		break
print(solved)


(n, k) = map(int, input().strip().split())
totalTime = 240
totalTime = totalTime - k
probNum = 0
for i in range(n):
	if totalTime - (i + 1) * 5 < 0:
		break
	else:
		totalTime = totalTime - (i + 1) * 5
		probNum = probNum + 1
print(probNum)


(n, k) = map(int, input().split())
r = 240 - k
c = 0
while r >= 0:
	r -= 5 * (c + 1)
	c += 1
print(min(c - 1, n))


(n, m) = map(int, input().split())
l = 240 - m
ss = []
x = [i * 5 + 5 for i in range(n)]
for i in range(n + 1):
	if sum(x[:i]) <= l:
		ss.append(i)
print(max(ss))


(n, k) = map(int, input().split())
t = 0
k = 240 - k
for j in range(n + 1):
	t += 5 * j
	if t > k:
		print(j - 1)
		break
else:
	print(j)


I = lambda : list(map(int, input().split()))
(n, k) = I()
valid = [i for i in range(n + 1) if k + 5 * i * (i + 1) / 2 <= 240]
if valid:
	print(valid[-1])
else:
	print(0)


(n, k) = map(int, input().split())
res = 0
num = 240 - k
timee = 0
i = 1
while i <= n:
	timee = timee + 5 * i
	if timee <= num:
		res = res + 1
		i = i + 1
	else:
		break
print(res)


(n, k) = input().split()
(n, k) = (int(n), int(k))
t = k / 60 + 20
c = 0
for i in range(1, n + 1):
	if i * 5 / 60 + t <= 24:
		t += 5 * i / 60
		c += 1
	else:
		break
print(c)


l = list(map(int, input().split()))
times = [5 * i for i in range(l[0] + 1)]
while True:
	if sum(times) + l[1] <= 240:
		print(l[0])
		quit()
	else:
		times.pop(-1)
		l[0] -= 1


import math
judge = True
if judge:
	from sys import stdin, stdout
else:
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')
(n, k) = list(map(int, stdin.readline().split()))
stdout.write(str(min(n, int(math.sqrt((240 - k) * 2 / 5 + 1 / 4) - 1 / 2))))
stdin.close()
stdout.close()


(n, k) = map(int, input().split())
while n * (n + 1) > 96 - 0.4 * k:
	n -= 1
print(n)


data = list(map(int, input().split()))
n = data[0]
time = data[1]
time = 240 - time
a = 0
s = 1
while time >= 5 * s and n > 0:
	time = time - 5 * s
	n = n - 1
	a = a + 1
	s = s + 1
print(a)


(a, b) = list(map(int, input().split()))
t = 240 - b
s = 0
c = 0
for i in range(1, a + 1):
	s += 5 * i
	if s <= t:
		c += 1
	else:
		break
print(c)


(n, t) = map(int, input().split())
have = 240 - t
c = 0
counter = 0
for i in range(1, n + 1):
	i *= 5
	c += i
	if c <= have:
		counter += 1
	else:
		break
print(counter)


(n, m) = list(map(int, input().split(' ')))
h = 240 - m
s = 0
res = n
for i in range(1, n + 1):
	s += 5 * i
	if s > h:
		res = i - 1
		break
print(res)


(n, k) = map(int, input().split())
x = 240 - k
d = 0
i = 1
while x >= 0:
	x = x - i * 5
	i = i + 1
	d = d + 1
if n >= d:
	print(d - 1)
else:
	print(n)


(n, k) = map(int, input().split())
time_left = 240 - k
problem = 1
while 5 * problem <= time_left:
	time_left -= 5 * problem
	problem += 1
print(min(n, problem - 1))


(n, k) = map(int, input().split())
a = 4 * 60 - k
ans = 0
while a > 0:
	ans += 1
	a -= ans * 5
	if a < 0:
		ans -= 1
print(min(ans, n))


def do():
	(n, k) = map(int, input().split())
	maxtime = 2 * (240 - k) / 5
	for i in range(1, n + 1):
		if i * (i + 1) > maxtime:
			return i - 1
	return n
print(str(do()))


def solve(n, k):
	total = 240 - k
	counter = 0
	for i in range(1, n + 1):
		if total - 5 * i >= 0:
			total -= 5 * i
			counter += 1
		else:
			break
	print(counter)

def main():
	l = [int(x) for x in input().split()]
	solve(l[0], l[1])
main()


(n, k) = map(int, input().split())
rent = 240 - k
i = 0
c = 0
while i < n and rent > 0:
	rent = rent - 5 * (i + 1)
	if rent >= 0:
		c = c + 1
	i = i + 1
print(c)


(n, k) = map(int, input().split())
ans = 0
while ans < n and 5 * ans * (ans + 1) < 2 * (240 - k):
	ans += 1
if 5 * ans * (ans + 1) <= int(2 * (240 - k)):
	print(ans)
else:
	print(ans - 1)


(n, party) = input().split()
n = int(n)
party = int(party)
avai = 60 * 4 - party
total_solved = 0
ptime = 5
i = 1
while avai >= ptime:
	avai -= ptime
	i += 1
	ptime = 5 * i
	total_solved += 1
	if total_solved == n:
		break
print(total_solved)


(n, k) = map(int, input().split())
a = 0
while (a + 2) * (a + 1) // 2 * 5 <= 240 - k:
	a += 1
print(min(n, a))


(p, k) = map(int, input().split())
s = 0
for i in range(1, p + 1):
	s += 5 * i
	if s > 240 - k:
		print(i - 1)
		break
	elif s == 240 - k:
		print(i)
		break
	if i == p:
		print(p)


(n, k) = map(int, input().split())
minutes = 240 - k
i = 1
count = 0
while 1:
	if minutes >= 5 * i and n > 0:
		minutes -= 5 * i
		count += 1
		n -= 1
		i += 1
	else:
		break
print(count)


(a, b) = map(int, input().split())
cnt = 0
sum = 0
n = 240 - b
for i in range(1, a + 1):
	x = 5 * i
	sum += x
	if sum <= n:
		cnt += 1
print(cnt)


(n, k) = map(int, input().split())
rem = 240 - k
i = 1
while True:
	if 5 * i * (i + 1) / 2 > rem:
		break
	i += 1
print(min(i - 1, n))


(n, k) = map(int, input().split())
m = 240 - k
i = 0
sum = 0
while 1:
	i += 1
	sum += 5 * i
	if i > n:
		print(n)
		break
	if sum > m:
		print(i - 1)
		break


__author__ = 'artyom'

def main():
	(n, k) = read(3)
	k = 240 - k
	s = t = i = 0
	while i <= n:
		t += 5
		s += t
		if s > k:
			break
		i += 1
	return min(i, n)

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
res = main()
write(res)


from sys import *
(n, k) = stdin.readline().split(' ')
n = int(n)
k = int(k)
t = 4 * 60 - k
ans = 0
i = 1
while ans != n:
	if i * 5 > t:
		break
	t -= i * 5
	ans += 1
	i += 1
print(ans)


(n, k) = map(int, input().split())
a = [0, 5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
time = 240 - k
for i in range(11):
	if a[i] > time:
		print(min(n, i - 1))
		break


(n, k) = input().split()
val = 4 * 60 - int(k)
c = 0
for i in range(1, int(n) + 1):
	x = 5 * i
	if val - x >= 0:
		c += 1
		val -= x
print(c)


(n, k) = map(int, input().split())
time = 60 * 4 - k
for i in range(1, n + 1):
	if i * 5 > time:
		print(i - 1)
		exit()
	else:
		time -= 5 * i
print(n)


(problems, time) = map(int, input().split())
time_available = 240 - time
time_wasted = 0
contador = 0
cond = True
while contador < problems:
	contador += 1
	time_wasted += contador * 5
	if time_wasted > time_available:
		time_wasted -= contador * 5
		print(contador - 1)
		cond = False
		break
if cond:
	print(contador)


(n, k) = map(int, input().split())
time = 1440 - (1200 + k)
sum = 0
count = 0
for i in range(1, n + 1):
	sum += i * 5
	if sum <= time:
		count += 1
print(count)


import sys
input = sys.stdin.readline

def main():
	(n, k) = map(int, input().split())
	time = 240 - k
	ans = -1
	cnt = 1
	while time >= 0:
		ans += 1
		time -= cnt * 5
		cnt += 1
	print(min(ans, n))
main()


(n, k) = input().split()
n = int(n)
k = int(k)
d = 0
for i in range(1, n + 1):
	d += 5 * i
while True:
	if d + k <= 240:
		break
	else:
		d -= n * 5
		n -= 1
print(n)


def codeforces(n, k):
	time = 240 - k
	for i in range(n):
		i += 1
		time -= i * 5
		if time < 0:
			return i - 1
	return n
(n, k) = map(int, input().split())
print(codeforces(n, k))


n = list(map(int, input().split()))
a = n[0]
b = n[1]
c = 240 - b
time = 0
count = 0
for i in range(1, a + 1):
	time += 5 * i
	if time <= c:
		count += 1
	else:
		break
print(count)


(n, m) = map(int, input().split())
a = 240 - m
c = 0
i = 1
while a - c >= 5 * i:
	c += 5 * i
	i += 1
print(min(i - 1, n))


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

def multiple_input():
	return map(int, input().split())
CONST = 240
(n, k) = multiple_input()
ans = 0
count = 0
for i in range(1, n + 1):
	ans += i * 5
	if ans + k <= CONST:
		count += 1
	else:
		break
print(count)


import math
(n, k) = list(map(int, input().split()))
if k >= 240:
	print(0)
else:
	i = math.ceil(math.sqrt(95.75 - 0.4 * k) - 0.5)
	if i * (i + 1) * 5 > 240 - k << 1:
		i -= 1
	print(min(n, i))


v = [int(x) for x in input().split(' ')]
a = v[0]
b = v[1]
timeLimit = 240 - b

def sumTime(x):
	s = 0
	for i in range(x + 1):
		s = s + i * 5
	return s
while sumTime(a) > timeLimit:
	a -= 1
print(a)


inp = [int(x) for x in input().split()]
time_left = 240 - inp[1]
problems = 0
for i in range(1, inp[0] + 1):
	if time_left >= i * 5:
		time_left -= i * 5
		problems += 1
print(problems)


(n, k) = [int(i) for i in input().split()]
time = 240 - k
i = 1
while time >= 0:
	time -= 5 * i
	i += 1
print(min(i - 2, n))


def rok(k, n):
	minuty = 60 * 4 - k
	zad = 0
	for i in range(n):
		if minuty >= (i + 1) * 5:
			minuty -= (i + 1) * 5
			zad += 1
		else:
			break
	print(zad)
(n, k) = input().split(' ')
rok(int(k), int(n))


(n, k) = map(int, input().split())
time = 240 - k
i = 1
flag = 1
while i <= n:
	temp = 5 * i * (i + 1) // 2
	if temp == time:
		flag = 0
		print(i)
		break
	if temp > time:
		flag = 0
		print(i - 1)
		break
	i += 1
if flag == 1:
	print(i - 1)


l = list(input().split())
q = int(l[0])
k = int(l[1])
time_left = 240 - k
i = 1
n = 0
while time_left >= n:
	n += 5 * i
	i += 1
if i - 2 <= q:
	print(i - 2)
else:
	print(q)


def read_tokens():
	return input().strip().split(' ')

def read_ints():
	return [int(s) for s in read_tokens()]

def how_many_problems(n: int, k: int):
	l = 0
	r = n + 1
	while r - l > 1:
		m = (r + l) // 2
		if possible(m, k):
			l = m
		else:
			r = m
	return l

def possible(number_of_tasks: int, time_for_walk: int):
	time_for_problems = sum([5 * i for i in range(1, number_of_tasks + 1)])
	total_time = 4 * 60
	return total_time - time_for_problems - time_for_walk >= 0
(n, k) = read_ints()
print(how_many_problems(n, k))


(n, k) = map(int, input().split(' '))
contest_duration = 240
contest_duration -= k
problem_solved = 0
problem_time_needed = 0
for i in range(n):
	if contest_duration - 5 * (i + 1) >= 0:
		problem_solved += 1
		contest_duration -= 5 * (i + 1)
	else:
		break
print(problem_solved)


(n, k) = [int(x) for x in input().split()]
m = 240 - k
s = 1
while m >= 5 * s:
	m = m - 5 * s
	s += 1
p = s - 1
print(min(p, n))


(n, k) = map(int, input().split())
print(max((p for p in range(n + 1) if 5 * (p * (p + 1) // 2) <= 240 - k)))


import math
(n, k) = list(map(int, input().split(' ')))
num = int((-5 + math.sqrt(25 + 40 * (240 - k))) / 10)
print(num if num <= n else n)


(n, k) = map(int, input().split())
time = 240 - k
if time >= 5 * n * (n + 1) / 2:
	print(n)
else:
	for i in range(1, n + 1):
		req = 5 * i * (i + 1) / 2
		if req > time:
			print(i - 1)
			break
		elif req == time:
			print(i)
			break


(n, t) = input().split()
n = int(n)
t = int(t)
h = 20
m = 0
q = t // 60
h = h + q
r = t % 60
m = m + r
c = 0
if h == 24 and m == 0:
	print(c)
else:
	for i in range(1, n + 1):
		s = i * 5
		m = m + s
		if h >= 23:
			if m <= 60:
				c = c + 1
			else:
				break
		elif m >= 60:
			h = h + 1
			m = m - 60
			c = c + 1
		else:
			c = c + 1
	print(c)


import math
(n, k) = [int(x) for x in input().split()]
K = 240 - k
a = (math.sqrt(25 + 40 * K) - 5) / 10
print(min(n, math.floor(a)))


a = [int(i) for i in input().split(' ')]
x = a[0]
y = a[1]
y = 240 - y
t = 0
while t <= x:
	if t * 5 <= y:
		y = y - t * 5
		t = t + 1
	else:
		break
t = t - 1
print(t)


(n, k) = [int(x) for x in input().split()]
time = 240 - k
m = -1
while n >= 0 and time >= 0:
	time = time - (m + 2) * 5
	n = n - 1
	m += 1
print(m)


a = [int(i) for i in input().split(' ')]
n = a[0]
k = a[1]
t = 240 - k
s = 0
m = 0
for i in range(1, n + 1):
	s = s + 5 * i
	if s > t:
		break
	m = m + 1
print(m)


from sys import stdin

def get_user_input():
	return list(map(int, stdin.readline().rstrip().split()))
input_list = get_user_input()
(n, k) = (input_list[0], input_list[1])
remain = 4 * 60 - k
count = 0
for i in range(1, n + 1):
	res = i * 5
	remain -= res
	if remain < 0:
		break
	count += 1
print(count)


(a, b) = map(int, input().split())
c = 240 - b
d = 0
d1 = 0
count = 0
while d <= c and a >= count:
	count += 1
	d1 += 1
	e = 5 * d1
	d += e
print(count - 1)


(n, m) = map(int, input().split())
m_4 = 240
count = 0
result_n = 0
for i in range(1, n + 1):
	count += 5 * i
	if count + m <= m_4:
		result_n += 1
	else:
		break
print(result_n)


(n, k) = map(int, input().split())
pref = 0
ok = False
for i in range(1, n + 1):
	pref += i * 5
	if pref > 240 - k:
		print(i - 1)
		ok = True
		break
if not ok:
	print(i)


(n, k) = map(int, input().split())
t = (240 - k) // 5
i = 0
a = 1
while a <= n:
	i += a
	if i > t:
		break
	a += 1
print(a - 1)


(n, t) = list(map(int, input().split()))
cs = [0] * n
f = 240 - t
cs[0] = 5
ans = 0
for i in range(1, n):
	cs[i] = cs[i - 1] + 5 * (i + 1)
for i in range(n):
	if cs[i] <= f:
		ans = i + 1
print(ans)


from math import ceil
(n, k) = map(int, input().split())
(cost, count, last) = ([], 0, 240 - k)
for i in range(n):
	count += (i + 1) * 5
	cost.append(count)
(a, b) = (0, n - 1)
mid = ceil((a + b) / 2)
max_num = -1
while a <= b:
	mid = a + ceil((b - a) / 2)
	if cost[int(mid)] > last:
		b = mid - 1
	elif cost[int(mid)] < last:
		a = mid + 1
		max_num = mid
	elif cost[int(mid)] == last:
		max_num = mid
		break
if max_num == -1:
	print('0')
else:
	print(int(max_num) + 1)


def ans(n, k):
	time = 240 - k
	arr = [5] * n
	for i in range(len(arr)):
		arr[i] = arr[i] * (i + 1)
	for i in range(1, len(arr)):
		arr[i] += arr[i - 1]
	return bsearch(arr, time) + 1

def bsearch(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] is x:
			return mid
		elif arr[mid] < x:
			ans = mid
			l = mid + 1
		else:
			r = mid - 1
	return ans
x = list(map(int, input().strip().split(' ')))
n = x[0]
k = x[1]
print(ans(n, k))


import sys
from math import sqrt, floor
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def solve():
	(n, k) = read()
	l = min(n, floor(sqrt((240 - k) // 5 * 2)) - 2)
	while (l + 1) * (l + 2) // 2 * 5 <= 240 - k and l < n:
		l += 1
	print(l)
solve()


from sys import stdin, stdout
(n, m) = map(int, input().split())
for i in range(n, -1, -1):
	if i * (i + 1) * 5 / 2 + m <= 240:
		print(i)
		break


(n, k) = [int(i) for i in input().split()]
s = 240 - k
for i in range(n):
	t = (i + 1) * 5
	s -= t
	h = i
	if s < 0:
		break
if k == 1 and n < 10 or s == 0 or s > t:
	print(n)
else:
	print(h)


(n, k) = list(map(int, input().split()))
a = 5
d = 5
time = 4 * 60 - k
printed = False
for i in range(1, n + 1):
	sum = 5 * i + i * (i - 1) * 5 // 2
	if time < sum:
		printed = True
		print(i - 1)
		break
if not printed:
	print(i)


(n, k) = map(int, input().split())
m = 240 - k
l = 0
if m == 0:
	print(0)
else:
	i = 1
	while m >= i * 5 and n != 0:
		m -= i * 5
		n -= 1
		l += 1
		i += 1
	print(l)


def count(i):
	k = 0
	for j in range(i + 1):
		k += 5 * j
	return k

def main():
	(m, n) = map(int, input().split())
	les = 240 - n
	kk = 0
	for i in range(m + 1):
		k = count(i)
		if k <= les:
			kk = i
	print(kk)
main()


(questions, time) = map(int, input().split())
attempts = 0
while attempts < questions and 2.5 * (attempts + 1) * (attempts + 2) <= 240 - time:
	attempts += 1
print(attempts)


(n, k) = map(int, input().split())
a = 240 - k
t = 5
s = 0
while t <= a and s < n:
	s = s + 1
	t = t + (s + 1) * 5
print(s)


(n, k) = map(int, input().split())
x = 240 - k
c = 0
time = 5 * n * (n + 1) // 2
if time < x:
	print(n)
elif x <= 4:
	print(0)
else:
	for i in range(n, 0, -1):
		if time <= x:
			print(n - c)
			break
		else:
			c += 1
			time -= 5 * i


(problems, time_to_home) = [int(x) for x in input().split()]
duration = 240
solved = 0
tracker = 1
time_to_solve = duration - time_to_home
while time_to_solve > 0 and problems > 0:
	if time_to_solve >= tracker * 5:
		time_to_solve -= tracker * 5
		tracker += 1
		problems -= 1
		solved += 1
	else:
		break
print(solved)


(n, k) = [int(num) for num in input().split()]
(res, s) = (0, 0)
for a in range(n + 1):
	if s + a * 5 + k > 240:
		break
	(res, s) = (a, s + a * 5)
print(res)


(n, k) = [int(i) for i in input().split()]
summ = 0
a = 1
while a <= n:
	if int(5 * a * (a + 1) / 2) + k > 240:
		break
	else:
		a += 1
print(a - 1)


(n, k) = input().split()
n = int(n)
k = int(k)
total_time = 240
time_utili = total_time - k
t = 0
count = 0
for i in range(1, n + 1):
	t = t + i * 5
	if t > time_utili:
		break
	count += 1
print(count)


(n, k) = map(int, input().split())
total = 240 - k
problems = 0
i = 1
while total > 0 and n > 0:
	total -= 5 * i
	if total < 0:
		break
	problems += 1
	i += 1
	n -= 1
print(problems)


(problems, time) = [int(s) for s in input().split()]
count = 0
for i in range(1, problems + 1):
	time += 5 * i
	if time > 240:
		break
	else:
		count += 1
print(count)


(n, k) = [int(i) for i in input().strip().split()]
k = 240 - k
for i in range(1, n + 2):
	if i == n + 1:
		print(n)
		break
	if 5 * i * (i + 1) > 2 * k:
		print(i - 1)
		break


(a, b) = map(int, input().split())
time = 240 - b
ans = 0
while 1:
	if time - (ans + 1) * 5 >= 0 and ans < a:
		ans += 1
		time -= ans * 5
	else:
		break
print(ans)


li = [int(i) for i in input().split()]
n = li[0]
mi = li[1]
t = 240
s = t - mi
min = 5
c = 0
while s >= min and c <= n:
	c += 1
	s -= min
	min += 5
if c > n:
	print(n)
else:
	print(c)


(n, k) = map(int, input().strip().split())
m = 240 - k
c = 0
cnt = 0
for i in range(1, n + 1):
	c += 5 * i
	if c > m:
		break
	else:
		cnt += 1
print(cnt)


(n, time) = map(int, input().split())
t = 4 * 60 - time
c = [x * 5 for x in range(1, n + 1)]
cost = 0
ct = 0
for i in c:
	if cost + i > t:
		break
	cost += i
	ct += 1
print(ct)


(n, k) = map(int, input().split())
x = 240 - k
c = 0
i = 1
while True and i <= n:
	x -= i * 5
	if x >= 0:
		c += 1
	else:
		break
	i += 1
print(c)


def counting(N, K):
	time = 240 - K
	timeOfProblem = 5
	max = 0
	while time - timeOfProblem >= 0:
		if N == max:
			return max
		time = time - timeOfProblem
		timeOfProblem = timeOfProblem + 5
		max = max + 1
	return max
(n, k) = map(int, input().split())
print(counting(n, k))


(n, k) = input().split()
n = int(n)
k = int(k)
afford_t = 240 - k
counter = 0
i = 1
time_taken = 0
while afford_t >= 0 and n != 0:
	time = i * 5
	afford_t -= time
	if afford_t < 0:
		break
	counter += 1
	i += 1
	n -= 1
print(counter)


(n, k) = list(map(int, input().split()))
left = 0
right = n + 1
while right > left + 1:
	middle = (left + right) // 2
	key = 0
	for i in range(1, middle + 1):
		key += 5 * i
	if key + k > 240:
		right = middle
	else:
		left = middle
print(left)


(n, k) = map(int, input().split())
(ans, i, time) = (0, 1, 240 - int(k))
while time > 0 and n != 0:
	if 5 * i <= time:
		time -= 5 * i
		ans += 1
		n -= 1
		i += 1
	else:
		break
print(ans)


(n, m) = map(int, input().split())
ost = 240 - m
count = 0
while ost >= (count + 1) * 5 and count < n:
	count += 1
	ost = ost - count * 5
print(count)


(n, k) = map(int, input().split())
m = [0, 5, 15, 30, 50, 75, 105, 140, 180, 225, 275, 330]
i = 0
t = 240 - k
for i in range(n, -1, -1):
	if m[i] <= t:
		print(i)
		break


s = input().split()
n = int(s[0])
k = int(s[1])
k = 240 - k
for i in range(1, n + 1):
	if k - i * 5 < 0:
		print(i - 1)
		exit()
	else:
		k = k - i * 5
print(n)


(n, k) = map(int, input().split())
d = 240 - k
tot = 0
if d < 5:
	print(0)
else:
	for i in range(1, n + 1):
		tot += 5 * i
		if tot == d:
			print(i)
			break
		elif tot > d:
			print(i - 1)
			break
		elif tot < d and i == n:
			print(i)
			break


a = input()
b = a.split()
n = int(b[0])
k = int(b[1])
p = 240 - k
low = 1
high = n
while low < high:
	mid = low + (high - low + 1) // 2
	if 5 * mid * (mid + 1) / 2 <= p:
		low = mid
	else:
		high = mid - 1
if 5 * low * (low + 1) / 2 > p:
	print(0)
else:
	print(low)


def solve():
	(n, k) = map(int, input().split())
	minutes = 240 - k
	tasks = 0
	while minutes >= (tasks + 1) * 5:
		minutes -= (tasks + 1) * 5
		tasks += 1
	print(min(n, tasks))
solve()


(n, k) = list(map(int, input().split()))
(answer, solve_time) = (0, 0)
for i in range(1, 240 - k):
	solve_time += i * 5
	if 240 - k >= solve_time:
		answer += 1
if answer > n:
	answer = n
print(answer)


num = input()
arr = []
count = 0
for i in range(0, len(num)):
	if num[i] == ' ':
		arr.append(int(num[count:i]))
		count = i + 1
	elif i == len(num) - 1:
		arr.append(int(num[count:len(num)]))
questions = arr[0]
friend_dist_time = arr[1]
total_time = 240
questions_time = total_time - friend_dist_time
solved = 0
while questions_time > 0 and questions > 0:
	questions_time -= 5 * (solved + 1)
	questions -= 1
	if questions_time >= 0:
		solved += 1
print(solved)


(n, k) = input().strip().split(' ')
(n, k) = [int(n), int(k)]
i = 0
sum1 = 0
while i <= n:
	sum1 += 5 * i
	if sum1 + k > 240:
		break
	i += 1
print(i - 1)


from sys import stdin, stdout
from collections import Counter
from collections import defaultdict
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math
ai = lambda : list(map(int, stdin.readline().split()))
ei = lambda : map(int, stdin.readline().split())
ip = lambda : int(stdin.readline().strip())
(n, k) = ei()
li = [5 * i for i in range(1, n + 1)]
for i in range(1, len(li)):
	li[i] += li[i - 1]
x = 240 - k
for i in range(len(li)):
	if li[i] > x:
		print(i)
		break
	elif li[i] == x:
		print(i + 1)
		break
else:
	print(len(li))


(n, k) = map(int, input().split())
timeleft = 240 - k
codetime = 0
codes = 0
i = 1
while i <= n:
	codetime += 5 * i
	if codetime > timeleft:
		break
	else:
		codes += 1
	i += 1
print(codes)


(n, t) = input().split(' ')
n = int(n)
t = int(t)
r = 240 - t
count = 0
while r >= 5 * (count + 1):
	r -= 5 * (count + 1)
	count += 1
prt = min(count, n)
print(prt)


(n, k) = map(int, input().split(' '))
total = 0
count = 0
for i in range(n):
	total += 5 * (i + 1)
	if not k + total > 240:
		count += 1
print(count)


temp = 0
nk = [int(x) for x in input().split()]
for i in range(1, nk[0] + 1):
	temp = i / 2 * (10 + (i - 1) * 5)
	if (temp + nk[1]) / 60 > 4:
		break
print(i if (temp + nk[1]) / 60 <= 4 else i - 1)


(n, k) = map(int, input().split())
a = list(range(n))
j = 0
m = 0
for i in range(1, n + 1):
	if i * (i + 1) <= 2 * (240 - k) / 5:
		m = i
print(m)


import math
(m, k) = map(int, input().split())
tmp = 240 - k
if 5 * (m ** 2 + m) <= 2 * tmp:
	print(m)
else:
	(b, a, c) = (5, 5, -tmp * 2)
	res = (-b + math.sqrt(b ** 2 - 4 * a * c)) / (2 * a)
	print(math.floor(res))


(n, k) = list(map(int, input().split()))
left = 240 - k
if left == 0:
	print(0)
else:
	sum = 0
	count = 0
	i = 1
	while sum <= left:
		sum = sum + 5 * i
		if sum > left:
			print(count)
			break
		elif sum == left:
			count = count + 1
			print(count)
			break
		i += 1
		count = count + 1
		if sum < left and n == count:
			print(count)
			break


(n, k) = map(int, input().split())
l = 240 - k
i = 1
s = 0
while s < l and i <= n:
	s += 5 * i
	i += 1
if s > l:
	i = i - 1
print(i - 1)


def main():
	(n, k) = map(int, input().split(' '))
	sum1 = 240 - k
	c = 0
	sum2 = 0
	for i in range(1, n + 1):
		sum2 += 5 * i
		if sum1 >= sum2:
			c += 1
		else:
			break
	print(c)
main()


a = list(map(int, input().split()))
l = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60]
time_left = 240 - a[1]
count = 0
for i in range(a[0]):
	if time_left >= l[i]:
		time_left -= l[i]
		count += 1
	else:
		break
print(count)


(a, b) = map(int, input().split())

def otvet(x, y):
	time = 240 - y
	while time < sum(range(5, 5 * x + 1, 5)):
		x -= 1
	print(x)
otvet(a, b)


max_min = 240
inps = list(map(int, input().split(' ')))
n = inps[0]
k = inps[1]
gym_time = max_min - k
ans = sum = 0
for i in range(1, n + 1):
	sum += i * 5
	if sum <= gym_time:
		ans = i
	else:
		break
print(ans)


string = input()
string = string.split(' ')
n = int(string[0])
k = int(string[1])
x = 240 - k
num_problems = 0
while 5 / 2 * (num_problems * (num_problems + 1)) <= x and num_problems <= n:
	num_problems += 1
print(num_problems - 1)


(n, k) = list(map(int, input().split()))
t = 240 - k
u = 0
for i in range(0, n + 1):
	u += 5 * i
	if u <= t:
		f = i
print(f)


(n, m) = map(int, input().split())
i = 1
a = 0
b = 0
count = 0
while i <= n:
	a = a + i * 5
	i += 1
	b = a + m
	if b <= 240:
		count += 1
print(count)


(n, k) = list(map(int, input().split()))
p = 240 - k
d = 0
for i in range(1, n + 1):
	if 5 * i <= p:
		d = d + 1
		p = p - 5 * i
	else:
		break
print(d)


(n, k) = map(int, input().split())
prevTime = 0
for i in range(1, n + 1):
	currTime = prevTime + i * 5
	if currTime + k == 240:
		print(i)
		break
	elif currTime + k > 240:
		print(i - 1)
		break
	prevTime = currTime
else:
	print(n)


(n, time_friend) = map(int, input().split())
solved = 0
time_left = 240 - time_friend
for i in range(n):
	if time_left > 0:
		time_left -= 5 * (i + 1)
		solved += 1
	else:
		break
if time_left >= 0:
	print(solved)
else:
	print(solved - 1)


(a, b) = map(int, input().split())
print(min(int(((1 + 8 * (240 - b) / 5) ** 0.5 - 1) / 2), a))


(n, k) = map(int, input().split())
sum = 0
mark = 0
for prob in range(1, n + 1):
	sum += 5 * prob
	if sum + k > 240:
		print(prob - 1)
		mark = 1
		break
if mark == 0:
	print(n)


def num(n, k):
	if k == 240:
		return 0
	else:
		i = pow(9625 - 40 * k, 0.5)
		i = (i - 5) / 10
		if i > n:
			return n
		return i
(n, k) = [int(x) for x in input().split()]
print(int(num(n, k)))


(probs, time) = map(int, input().split())
time = 240 - time
for x in range(1, probs + 1):
	time -= 5 * x
	if time < 0:
		print(x - 1)
		break
else:
	print(probs)


(n, k) = map(int, input().split())
i = 1
time = 240
available_time = 240 - k
if available_time < 5:
	print(0)
elif available_time == 5:
	print(1)
else:
	while available_time >= i * 5 and i <= n:
		available_time -= 5 * i
		i += 1
	print(i - 1)


(n, k) = map(int, input().split())
c = 240 - k
w = 0
l = 0
for i in range(1, n + 1):
	w = i * 5
	c = c - w
	if c >= 0:
		l += 1
print(l)


import sys
(n, a) = map(int, sys.stdin.readline().split())
x = 240 - a
i = 0
while x >= i * 5 and i <= n:
	x -= i * 5
	i += 1
print(i - 1)


(n, k) = [int(i) for i in input().split()]
problemsTime = 240 - k
problemsDone = 0
for i in range(1, n + 1):
	if problemsTime - 5 * i * (i + 1) / 2 >= 0:
		problemsDone = i
	else:
		break
print(problemsDone)


(n, k) = map(int, input().split())
s = int((96 - 0.4 * k) ** 0.5)
f = 96 - 0.4 * k
while s * (s + 1) > f:
	s -= 1
print(min(n, s))


(n, t) = map(int, input().split())
start_hr = 20 + t // 60
start_min = t % 60
(t, j, count) = (0, 0, 0)
if start_hr > 24 and start_min > 56:
	print(0)
else:
	for i in range(1, n + 1):
		j = 5 * i
		if start_min + j > 60:
			start_hr += 1
			start_min = start_min + j
			start_min -= 60
		else:
			start_min += j
		if start_hr < 24 and start_min <= 60 or (start_hr == 24 and start_min == 60):
			count += 1
		else:
			break
	print(count)


def main():
	(n, k) = read()
	avail = 240 - k
	i = 1
	while i <= n and avail >= 5 * i:
		avail -= 5 * i
		i += 1
	print(i - 1)

def read(callback=int):
	return list(map(callback, input().strip().split()))

def write(value, end='\n'):
	if value is None:
		return
	try:
		value = ' '.join(map(str, value))
	except:
		pass
	print(value, end=end)
write(main())


sum = 0
a = 0
count = 0
(n, m) = map(int, input().split())
for i in range(1, n + 1):
	sum = sum + 5 * i
	if 240 >= sum + m:
		count = count + 1
print(count)


summ = ans = 0
res = 240
(n, k) = map(int, input().split())
sub = res - k
for i in range(1, n + 1):
	summ += 5 * i
	if summ <= sub:
		ans += 1
print(ans)


arr = input()
arr = arr.split(' ')
time_left = int(240 - int(arr[1]))
no_of_problems = 0
time_spent = 0
for i in range(1, int(arr[0]) + 1):
	time_spent += 5 * i
	if time_spent > time_left:
		break
	else:
		no_of_problems += 1
print(no_of_problems)


(k, n) = map(int, input().split())
t = 4 * 60
t -= n
i = 5 * ((1 + k) * k // 2)
while 1:
	if i > t:
		k -= 1
		i = 5 * ((1 + k) * k // 2)
	else:
		break
print(k)


nk = input('').split(' ')
p = range(1, int(nk[0]) + 1)
k = int(nk[1])
m = max([0] + [i for i in p if 240 - k - 5 * sum(p[:i]) >= 0])
print(m)


(problems, timeTo) = map(int, input().split())
timeFor = 5
i = 1
while timeFor < 240 - timeTo and i != problems:
	i += 1
	timeFor = timeFor + 5 * i
if timeFor > 240 - timeTo:
	print(i - 1)
else:
	print(i)


(n, k) = map(int, input().split())
starting = 240 - k
for (t, x) in enumerate(range(1, n + 1)):
	starting -= x * 5
	if starting < 0:
		problems = t
		break
else:
	problems = t + 1
print(problems)


(p, totaltime) = map(int, input().split())
tfp = 240 - totaltime
tt = 0
count = 0
for i in range(1, p + 1):
	tt += i * 5
	if tt <= tfp:
		count += 1
print(count)


total_time = 240
(n, k) = input().split(' ')
(n, k) = (int(n), int(k))
time_tosolve = 0
solve = 0
for i in range(1, n + 1):
	time_tosolve += i * 5
	solve += 1
	if k + time_tosolve > total_time:
		solve -= 1
		break
print(solve)


(problems, minutes) = [int(i) for i in input().split()]
time = minutes
output = 0
for i in range(problems):
	time += 5 * (i + 1)
	if time <= 240:
		output += 1
	else:
		break
print(output)


import sys
import math
t = list(input().split())
t = [int(i) for i in t]
n = t[0]
k = t[1]
l = [None] * n
for i in range(0, n):
	l[i] = 5 * (i + 1)
cnt = 0
for i in l:
	if k + i > 240:
		break
	cnt += 1
	k += i
print(cnt)


(n, k) = [int(x) for x in input().split()]
l = []
t = 240 - k
for i in range(n):
	l.append((i + 1) * 5)
(val, cnt) = (0, 0)
for j in range(n):
	val = val + l[j]
	if val > t:
		break
	cnt = cnt + 1
print(cnt)


def solution():
	(n, k) = map(int, input().split())
	starting = 240 - k
	for x in range(1, n + 1):
		problems = x
		starting -= x * 5
		if starting < 0:
			problems -= 1
			break
	print(problems)
solution()


(n, k) = map(int, input().split())
z = 240 - k
ans = 0
if 5 * n * (n + 1) / 2 <= z:
	ans = n
else:
	temp = 0
	i = 1
	while temp <= z:
		temp = temp + 5 * i
		i = i + 1
	ans = i - 2
print(ans)


(n, k) = list(map(int, input().strip().split(' ')))
TIME = 4 * 60 - k
for i in range(0, n + 1):
	if 5 * (i * (i + 1) // 2) <= TIME:
		1
	else:
		break
else:
	i += 1
ans = i - 1
print(ans)


(n, m) = [int(x) for x in input().split()]
time = 240 - m
s = 0
c = 0
for i in range(1, n + 1):
	s = s + i * 5
	if s > time:
		break
	c = c + 1
print(c)


(n, k) = map(int, input().split())
times = [int(2.5 * i * (i + 1)) for i in range(1, n + 1)]
time_left = 240 - k
beg = 0
end = n - 1
while beg < end:
	mid = (beg + end) // 2
	if times[mid] > time_left:
		end = mid
	elif times[mid] <= time_left:
		beg = mid + 1
if times[beg] <= time_left:
	res = beg + 1
else:
	res = beg
print(res)


(n, k) = [int(x) for x in input().split()]
k = 240 - k
l = 0
m = int((l + n) / 2)
while l != m:
	if int(5 * m * (m + 1) / 2) <= k:
		l = m
		m = int((l + n) / 2)
	else:
		n = m
		m = int((l + n) / 2)
if int(5 * n * (n + 1) / 2) <= k:
	print(n)
else:
	print(m)


nk = [int(i) for i in input().split()]
n = nk[0]
k = nk[1]
time = 240 - k
a = True
for i in range(n):
	if time < 5 * (i + 1):
		print(i)
		a = False
		break
	else:
		time -= 5 * (i + 1)
if a:
	print(n)


def print_value(counted, left, n):
	if counted <= left:
		print(n)
	elif counted > left:
		print(n - 1)
(n, m) = list(map(int, input().split()))
left = 240 - m
s = 0
for i in range(1, n + 1):
	s = s + 5 * i
	if s >= left:
		break
print_value(s, left, i)


(N, K) = map(int, input().split())
max = 240 - K
sum = 0
for i in range(0, N):
	sum += (i + 1) * 5
	if max < sum:
		print(i)
		break
	if i == N - 1:
		print(N)


(n, k) = [int(x) for x in input().split()]
t = 240 - k
s = 0
for x in range(1, n + 1):
	s += 5 * x
	if s > t:
		print(x - 1)
		break
	elif s == t or x == n:
		print(x)
		break


x = [int(n) for n in input().split()]
t = 240 - x[1]
q = int(t / 5) * 2
y = (-1 + (1 + 4 * q) ** 0.5) / 2
if y < x[0]:
	print(int(y))
else:
	print(x[0])


(n, m) = list(map(int, input().split()))
t = 4 * 60 - m
o = 0
a = 5
otv = 0
while o + a <= t and otv < n:
	o += a
	a += 5
	otv += 1
print(otv)


(n, k) = map(int, input().split())
time_available = 240 - k
time_for_solving = [5 * (i + 1) for i in range(n)]
index = 0
while time_available >= 0 and index < len(time_for_solving):
	time_available -= time_for_solving[index]
	if time_available < 0:
		break
	index += 1
print(index)


(a, b) = map(int, input().split())
s = 240 - b
p = 0
n = 0
for i in range(1, a + 1):
	p = p + i * 5
	n = n + 1
	if p > s:
		n = n - 1
		break
print(n)


(n, k) = map(int, input().split())
remaining_time = 240 - k
c = 0
s = 0
for i in range(1, n + 1):
	s += 5 * i
	if s > remaining_time:
		break
	c += 1
print(c)


(n, k) = [int(e) for e in input().split()]
a = int((-5 + (25 - 40 * (k - 240)) ** 0.5) / 10)
if a > n:
	print(n)
else:
	print(a)


(n, k) = map(int, input().split())
s = 0
a = 0
while a < n:
	if s <= 240 - k:
		s += 5 * (a + 1)
		if s <= 240 - k:
			a = a + 1
	else:
		break
print(a)


(n, k) = list(map(int, input().split()))
minutes = 4 * 60 - k
time = 0
flag = 0
for i in range(1, n + 1):
	time += 5 * i
	if time > minutes:
		flag = 1
		break
if flag:
	print(i - 1)
else:
	print(i)


(problems, minutes) = map(int, input().split())
time_dare = 240 - minutes
sum = 0
bam = 0
for i in range(1, problems + 1):
	sum += 5 * i
	if sum > time_dare:
		break
	bam += 1
print(bam)


tmp = input().split()
iloZ = int(tmp[0])
iloM = int(tmp[1])
czas = 5
iloM2 = 240
iloM2 -= iloM
i = 0
while iloM2 - czas >= 0:
	iloM2 -= czas
	czas += 5
	i += 1
if i > iloZ:
	print(iloZ)
else:
	print(i)


import math
(n, k) = map(int, input().split())
ans = 240 - k
(left, right) = (0, n)
s = 0
while True:
	mid = (left + right) // 2
	if left >= right:
		break
	s = (5 + mid * 5) / 2 * mid
	if ans - s < 0:
		right = mid - 1
	elif ans - s > 0:
		left = mid + 1
	else:
		break
if ans - (5 + mid * 5) / 2 * mid < 0:
	print(mid - 1)
else:
	print(mid)


str = input()
(n1, k1) = str.split(' ')
n = int(n1)
k = int(k1)
total = 240
c = n
for i in range(1, n + 1):
	k += i * 5
	if k > total:
		c = i - 1
		break
print(c)


import math
(no_prob, time_till_house) = list(map(int, input().split(' ')))
total_time = 4 * 60 - time_till_house
i = 1
while total_time >= i * 5:
	total_time -= i * 5
	i += 1
print(min(i - 1, no_prob))


import sys
(n, k) = [int(i) for i in input().split()]
total = 240
cur = 0
i = 1
while i <= n:
	cur += i * 5
	if cur > total - k:
		cur -= i * 5
		i -= 1
		break
	i += 1
else:
	print(i - 1)
	sys.exit()
print(i)


(n, a) = map(int, input().split())
a = (240 - a) // 5
a = int((-1 + (1 + 8 * a) ** 0.5) / 2)
if n > a:
	print(a)
else:
	print(n)


(a, b) = input().split()
a = int(a)
t = 240 - int(b)
i = 5
c = 0
while t - i >= 0 and a > 0:
	t = t - i
	i = i + 5
	a = a - 1
	c = c + 1
print(c)


(nos_questions, party_timer) = map(int, input().split())
party_timer = 240 - party_timer

def hurry(nos_questions, party_timer):
	i = 1
	question = 5 * i
	number = 0
	while question <= party_timer and i <= nos_questions:
		number += 1
		i += 1
		question += 5 * i
	return number
print(hurry(nos_questions, party_timer))


(a, b) = map(int, input().split())
s = b
d = 0
for i in range(1, a + 1):
	s = s + 5 * i
	if s <= 240:
		d = d + 1
		continue
print(d)


(n, k) = [int(tmp) for tmp in input().split()]
left = 240 - k
ans = 0
i = 1
while i <= n:
	if left - 5 * i < 0:
		break
	else:
		left -= 5 * i
		ans += 1
		i += 1
print(ans)


li = input().split()
n = int(li[0])
k = int(li[1])
b = 240 - k
ms = 0
j = 0
for i in range(1, n + 1):
	ms += 5 * i
	j += 1
	if ms > b:
		j = j - 1
		break
print(j)


import math
(n, k) = map(int, input().split())
timeToSolve = 240 - k
problems = math.floor(timeToSolve / 5)
problems = math.floor((math.sqrt(1 + 8 * problems) - 1) / 2)
print(n if problems > n else problems)


import math
(n, k) = map(int, input().split())
d = 1200 + k
d = 1440 - d
x = n * (n + 1) // 2
x = x * 5
if x <= d:
	print(n)
else:
	s = math.ceil(d / 4)
	h = math.ceil(math.sqrt(s))
	h += 10
	e = h * (h + 1) // 2
	e *= 5
	while e > d:
		h -= 1
		e = h * (h + 1) // 2
		e *= 5
	print(h)


(a, b) = map(int, input().split())
rt = 240 - b
i = 1
count = 0
while rt > 0 and count < a:
	if i * 5 <= rt:
		count = count + 1
		rt = rt - i * 5
		i = i + 1
	else:
		break
print(count)


(a, m) = map(int, input().split())
t = 240 - m
j = 0
for i in range(a + 1):
	j += i * 5
	if j > t:
		print(i - 1)
		exit()
print(a)


(n, k) = map(int, input().split())
a = [i * (i + 1) // 2 for i in range(1, n + 1)]
print(sum(map(lambda x: x <= (240 - k) // 5, a)))


l = list(map(int, input().split()))
(n, k) = (l[0], l[1])
c = 0
sum = k
while sum < 240 and c < n:
	c += 1
	sum += 5 * c
if c > n:
	c -= 1
if sum <= 240:
	print(c)
else:
	print(c - 1)


(number, needtime) = map(int, input().split())
testtime = 240 - needtime
mmmmax = (-5 + (25 + 40 * testtime) ** (1 / 2)) / 10
if number <= mmmmax:
	print(number)
else:
	print(int(mmmmax))


(n, time) = map(int, input().split())
rem = 240 - time
s = 0
for i in range(1, n + 1):
	s += 5 * i
	if s > rem:
		print(i - 1)
		break
	elif i == n:
		print(n)


from itertools import product, combinations
from math import sqrt
(n, k) = map(int, input().split())
i = 0
while 5 * i * (i + 1) // 2 + k <= 240:
	i += 1
print(min(i - 1, n))


(a, b) = list(map(int, input().split()))
b = (240 - b) // 5
s = 0
for i in range(1, a + 1):
	if b < 1 or b < i:
		break
	b -= i
	s += 1
print(s)


(n, k) = map(int, input().split())
total = 60 * 4
t = k
i = 0
while t < total and i < n:
	t += 5 * (i + 1)
	i += 1
if t > total:
	print(i - 1)
else:
	print(i)


string_input = input().split(' ')
n = int(string_input[0])
k = 240 - int(string_input[1])
s = 0
i = 0
while s <= k and i <= n:
	i += 1
	s += 5 * i
else:
	i -= 1
print(i)


l = list(map(int, input().split()))
n = l[0]
k = l[1]
p = 240 - k
c = 0
i = 0
while c <= p:
	i += 1
	c += 5 * i
print(min(i - 1, n))


(n, k) = map(int, input().split())
b = 240
left = 240 - k
prob = n
count = 0
while left - 5 * (count + 1) >= 0 and prob > 0:
	count += 1
	prob -= 1
	left -= 5 * count
print(count)


(n, k) = map(int, input().split())
ans = 0
time = 240 - k
i = 1
spent = 0
while i <= n and spent + 5 * i <= time:
	spent += 5 * i
	i += 1
	ans += 1
print(ans)


(a, b) = map(int, input().split())
(f, m) = (0, 0)
for i in range(1, a + 1):
	m = m + i * 5
	if m > 240 - b:
		print(i - 1)
		f = 1
		break
if f == 0:
	print(i)


(n, k) = map(int, input().split())
f = True
for i in range(1, n + 1):
	if 5 * i * (i + 1) / 2 + k > 240:
		f = False
		break
if not f:
	print(i - 1)
else:
	print(i)


(n, k) = map(int, input().split())
if k >= 240:
	print(0)
	exit()
else:
	k = 240 - k
	sum = 0
	counter = 0
	for i in range(1, n + 1):
		if i * 5 <= k and sum + i * 5 <= k:
			sum += i * 5
			counter += 1
	print(counter)


(n, k) = map(int, input().split())
m = []
s = 0
count = 0
for i in range(1, n + 1):
	m.append(5 * i)
	s = s + 5 * i
	if s + k <= 240:
		count += 1
print(count)


(n, m) = map(int, input().split())
x = 240 - m
answ = -1
ans = 0
for i in range(n):
	ans += (i + 1) * 5
	if ans >= x:
		if ans == x:
			answ = i + 1
		else:
			answ = i
		break
if answ == -1:
	print(n)
else:
	print(answ)


input_s = input().split(' ')
n = int(input_s[0])
k = int(input_s[1])
i = 1
s = 0
while 240 - k >= s + i * 5 and i <= n:
	s += i * 5
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
time = lambda a: (5 * a + 5) * a / 2
ans = 0
while 240 - k >= time(ans):
	ans += 1
print(min(n, ans - 1))


(num, road) = [int(x) for x in input().split()]
surplus = 240 - road
i = 1
while 5 * i * (i + 1) / 2 <= surplus and i <= num:
	i += 1
print(i - 1)


from sys import stdout
(n, k) = input().split()
n = int(n)
k = int(k)
problems = 0
total = 60 * 4 - k
for i in range(n):
	if total >= 5 * (i + 1):
		problems = problems + 1
		total = total - 5 * (i + 1)
print(problems)


(n, k) = map(int, input().split())
b = 240
sum1 = 0
for i in range(1, n + 1):
	sum1 += 5 * i
a = sum1 + k
if a <= b:
	print(n)
else:
	l = [0] * (n + 1)
	c = 0
	i = 1
	while True:
		l[i] = 5 * i
		i += 1
		if sum(l) + k > b:
			break
		else:
			c += 1
	print(c)


(a, b) = input().split()
diff = 240 - int(b)
cnt = 0
sum = 0
for i in range(int(a)):
	sum = sum + 5 * (i + 1)
	if sum > diff:
		print(i)
		cnt = 1
		break
	else:
		pass
if cnt != 1:
	print(a)


(n, k) = map(int, input().split())
time = 4 * 60
i = 0
while k < time:
	if i == n:
		break
	else:
		i += 1
		k += i * 5
print(i if k <= time else i - 1)


(n, k) = [int(x) for x in input().split()]
question = 0
t = 0
time = 4 * 60 - k
while question != n:
	if t + (question + 1) * 5 <= time:
		question += 1
		t += question * 5
	else:
		break
print(question)


from collections import defaultdict
import math
(n, k) = map(int, input().split())
t = 240 - k
ans = (-5 + math.sqrt(25 + 40 * t)) // 10
if ans > n:
	ans = n
print(int(ans))


(n, k) = [int(x) for x in input().split()]
time = 240 - k
for counter in range(1, n + 1):
	if time - counter * 5 < 0:
		print(counter - 1)
		break
	time -= counter * 5
else:
	print(n)


list = str.split(input())
n = int(list[0])
k = int(list[1])
time = (240 - k) // 5
if time >= 1:
	for i in range(n, 0, -1):
		sum = i * (i + 1) // 2
		if sum <= time:
			print(i)
			break
else:
	print(0)


(n, k) = map(int, input().split())
b = 240 - k
li = []
sum = 0
count = 0
for i in range(1, n + 1):
	li.append(i * 5)
for i in li:
	sum += i
	if sum <= b:
		count += 1
print(count)


(a, b) = input().split()
a = int(a)
b = int(b)
f = 0
count = 0
time_left = 240 - b
for i in range(a + 1):
	if f <= time_left:
		f += 5 * i + 5
		count += 1
print(count - 1)


read = lambda : map(int, input().split())
(n, k) = read()
t = 240 - k
cur = 0
for i in range(1, n + 1):
	c = 5 * i
	if cur + c > t:
		ans = i - 1
		break
	cur += c
else:
	ans = n
print(ans)


(n, k) = map(int, input().split())
l = 240 - k
f = 0
if l <= 0:
	print(0)
else:
	r = 0
	for i in range(1, n + 1):
		r = r + i * 5
		if r > l:
			t = i - 1
			f = 1
			break
		elif r == l:
			t = i
			f = 1
			break
	if f == 1:
		print(t)
	elif f == 0:
		print(i)


(n, k) = [int(x) for x in input().split()]
s = 0
i = 0
if k > 240:
	print('0')
else:
	while s + k <= 240:
		i = i + 1
		s = s + 5 * i
	print(min(i - 1, n))


(n, k) = map(int, input().split())
time = 240 - k
num = 0
while time >= 0:
	t = 5 * num
	time = time - t
	num += 1
num -= 2
print(min(num, n))


(n, k) = input().split()
n = int(n)
k = int(k)
arr = [5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
for i in range(n, 0, -1):
	if arr[i - 1] + k <= 240:
		break
if arr[i - 1] + k <= 240:
	print(i)
else:
	print(0)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return abs(a // gcd(a, b) * b)

def primesbelow(N):
	correction = N % 6 > 1
	N = {0: N, 1: N - 1, 2: N + 4, 3: N + 3, 4: N + 2, 5: N + 1}[N % 6]
	sieve = [True] * (N // 3)
	sieve[0] = False
	for i in range(int(N ** 0.5) // 3 + 1):
		if sieve[i]:
			k = 3 * i + 1 | 1
			sieve[k * k // 3::2 * k] = [False] * ((N // 6 - k * k // 6 - 1) // k + 1)
			sieve[(k * k + 4 * k - 2 * k * (i % 2)) // 3::2 * k] = [False] * ((N // 6 - (k * k + 4 * k - 2 * k * (i % 2)) // 6 - 1) // k + 1)
	return [2, 3] + [3 * i + 1 | 1 for i in range(1, N // 3 - correction) if sieve[i]]
smallprimeset = set(primesbelow(100000))

def solve():
	t = 240
	(n, k) = sep()
	ans = n
	t -= k
	s = 0
	for i in range(n):
		if s + 5 * (i + 1) > t:
			ans = i
			break
		else:
			s += 5 * (i + 1)
	print(ans)
solve()


row = [int(x) for x in input().split()]
(n, k) = row
time = 240 - k
problems = 0
for i in range(1, n + 1):
	time -= i * 5
	if time < 0:
		break
	else:
		problems += 1
print(problems)


def main():
	n = input()
	arr = n.split()
	x = int(arr[0])
	y = 240 - int(arr[1])
	i = 1
	ans = 0
	while i <= x and y >= 5 * i:
		y -= 5 * i
		i += 1
		ans += 1
	print(ans)
main()


(n, k) = list(map(int, input().split()))
tot = 0
for i in range(n + 1):
	tot += i
	if tot * 5 > 240 - k:
		ans = i - 1
		break
	else:
		ans = n
print(ans)


(n, k) = input().split(' ')
n = int(n)
k = int(k)
z = True
for i in range(1, n + 1):
	if 5 * i + k > 240:
		print(i - 1)
		z = False
		break
	else:
		k += 5 * i
if z:
	print(n)


import math
(x, y) = map(int, input().split())
k = (-5 + math.sqrt(9625 - 40 * y)) // 10
if k < x:
	print(math.floor(k))
else:
	print(x)


u = [int(i) for i in input().split()]
(n, k) = (u[0], u[1])
time = 240 - k
res = 0
for i in range(n):
	if time - 5 * (i + 1) >= 0:
		time -= (i + 1) * 5
		res += 1
print(res)


import sys
inp = sys.stdin.readline().split()
inp = [int(i) for i in inp]
n = inp[0]
k = inp[1]
t = 240 - k
p = 0
c = 5
while t > 0 and n > 0:
	t -= c
	n -= 1
	c += 5
	if t >= 0 and n >= -1:
		p += 1
	else:
		break
print(p)


(n, k) = map(int, input().split())
l = 240 - k
lst = []
for i in range(1, n + 1):
	lst.append(i * 5)
sum = 0
cnt = 0
for i in lst:
	if sum + i <= l:
		sum += i
		cnt += 1
	else:
		break
print(cnt)


(m, n) = map(int, input().split())
res = 0
for i in range(m):
	if 5 * (i + 1) * (i + 2) // 2 <= 240 - n:
		res += 1
print(res)


(prob, minutes) = map(int, input().split(' '))

def totalTime(p):
	return sum([5 * i for i in range(1, p + 1)])

def canSolve(p, solving_time):
	if totalTime(p) <= solving_time:
		return True
	return False

def solvedProblems(prob, minutes):
	for i in range(prob + 1):
		if canSolve(i, 240 - minutes):
			questions = i
	return questions
print(solvedProblems(prob, minutes))


(n, k) = map(int, input().split())
c = 240
su = 0
j = 1
count = 0
val = 240 - k
while j <= n:
	su = su + 5 * j
	if su <= val:
		count = count + 1
	j = j + 1
print(count)


(n, k) = map(int, input().split())
nandk = 240 - k
zero = 0
for i in range(1, n + 1):
	if 5 * i <= nandk:
		nandk -= 5 * i
		zero += 1
print(zero)


from sys import stdin
(n, t) = map(int, stdin.readline().rstrip().split())
t = 240 - t
c = 1
while t - c * 5 >= 0:
	t -= c * 5
	c += 1
print(min(c - 1, n))


(N, K) = map(int, input().split())
rem = 240 - K
cnt = 5
acc = 0
ans = 0
while acc < rem:
	if acc + cnt <= rem:
		acc += cnt
		ans += 1
		cnt = 5 * (ans + 1)
	else:
		break
print(min(N, ans))


(n, k) = map(int, input().split())
rem = 240 - k
count = 0
l = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
j = 0
for i in l:
	j += i
	if j <= rem:
		count += 1
	else:
		break
if count > n:
	print(n)
else:
	print(count)


(a, b) = list(map(int, input().split()))
c = 240 - b
i = 1
d = 0
e = 0
while i <= a:
	d = d + 5 * i
	if d <= c:
		e += 1
		i += 1
	else:
		break
print(e)


(n, k) = list(map(int, input().split()))
low = 0
high = n
while low <= high:
	mid = (low + high) // 2
	if mid * (mid + 1) // 2 * 5 <= 240 - k:
		low = mid + 1
	else:
		high = mid - 1
print(high)


(n, k) = map(int, input().split())
tSum = 0
cnt = 0
i = 1
while i <= n:
	tSum += 5 * i
	if tSum > 240 - k:
		break
	else:
		cnt += 1
	i += 1
print(cnt)


a = list(map(int, input().split()))
v = 240 - a[1]
c = 1
while v - c * 5 >= 0 and c < a[0] + 1:
	v -= c * 5
	c += 1
print(c - 1)


(n, k) = [int(i) for i in input().split()]
rm = 240 - k
curExe = 1
res = 0
while True:
	if rm >= 5 * curExe:
		res += 1
		rm -= 5 * curExe
		curExe += 1
	else:
		break
print(min(n, res))


def is_pos(m, k):
	if 5 * m * (m + 1) <= 2 * (240 - k):
		return True
	else:
		return False

def max_prob(n, k):
	l = 0
	r = n
	while l <= r:
		mid = (l + r) // 2
		if is_pos(mid, k):
			l = mid + 1
		else:
			r = mid - 1
	return r
(n, k) = tuple(map(int, input().split()))
print(max_prob(n, k))


def sumAP(a):
	return a / 2 * (10 + (a - 1) * 5)
l = input()
l = [int(i) for i in l.split() if i.isdigit()]
i = 0
while i <= l[0]:
	if sumAP(i + 1) + l[1] > 240:
		break
	i += 1
if i > l[0]:
	print(l[0])
else:
	print(i)


t = input()
(n, k) = t.split()
minutes = 240 - int(k)
i = 0
for x in range(int(n)):
	i = i + 5 * (x + 1)
	if i > minutes:
		print(x)
		exit()
if i <= minutes:
	print(n)


from math import sqrt, floor
(n, k) = map(int, input().split())
print(min(n, floor(0.5 * (-1 + sqrt(1 + 4 * (96 - 0.4 * k))))))


available = 4 * 60
(n, k) = list(map(int, input().split()))
available -= k
solved = 0
for i in range(1, n + 1):
	if available - i * 5 >= 0:
		solved += 1
		available -= i * 5
	else:
		break
print(solved)


(p, t) = map(int, input().split())
ttime = 4 * 60
rm = ttime - t
s = 0
count = 0
for i in range(1, p + 1):
	s = s + i * 5
	if s <= rm:
		count = count + 1
	else:
		break
print(count)


ln = input().split(' ')
n = int(ln[0])
k = int(ln[1])
t = 240
res = 0
t -= k
for i in range(1, n + 1):
	if t < i * 5:
		break
	else:
		t -= i * 5
		res += 1
print(str(res))


try:
	(n, k) = list(map(int, input().split()))
	a = 240 - k
	i = 1
	sum = 0
	while sum <= a:
		sum = sum + 5 * i
		i += 1
	i = i - 2
	if i > n:
		print(n)
	else:
		print(i)
except:
	pass


def newYearHurry():
	values = input().split()
	time = 0
	count = 0
	for i in range(1, int(values[0]) + 1):
		time += i * 5
		if 240 - time >= int(values[1]):
			count += 1
	print(count)
newYearHurry()


import math
(n, m) = map(int, input().split())
a = int((240 - m) / 5)
d = 8 * a + 1
s = (math.sqrt(d) - 1) / 2
print(min(int(s), n))


(ques, route) = input().split(' ')
ques = int(ques)
route = int(route)
time = 4 * 60
left_time = time - route
can = 0
for i in range(ques):
	left_time -= 5 * (i + 1)
	if left_time < 0:
		break
	can += 1
print(can)


s = input()
if ',' in s:
	(n, k) = map(int, s.split(','))
else:
	(n, k) = map(int, s.split())
p = 240 - k
c = 0
i = 5
while p >= i:
	c += 1
	p -= i
	i += 5
if c > n:
	print(n)
else:
	print(c)


(n, k) = map(int, input().split())
while True:
	time = 5 * n * (n + 1) / 2 + k
	if time > 240:
		n -= 1
	elif time <= 240:
		print(n)
		break


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def solve():
	(n, k) = read()
	(lo, hi) = (0, n)
	while hi - lo > 1:
		mid = (hi + lo) // 2
		if 240 - mid * (mid + 1) * 5 // 2 >= k:
			lo = mid
		else:
			hi = mid - 1
	if 240 - lo * (lo + 1) * 5 // 2 >= k:
		mid = lo
	if 240 - hi * (hi + 1) * 5 // 2 >= k:
		mid = hi
	print(mid)
solve()


nk = tuple(map(int, input().split()))
i = 1
c = 5
ans = 0
while ans < nk[0] and c + nk[1] <= 240:
	ans += 1
	i += 1
	c += 5 * i
print(ans)


(n, k) = map(int, input().split())
worktime = 0
time = 240 - k
solved = 0
const = 5
for x in range(1, n + 1):
	if worktime + x * const <= time:
		solved += 1
		worktime += x * 5
print(solved)


(n, k) = [int(x) for x in input().split()]
remain = 240 - k
sum = 0
i = 0
while True:
	i += 1
	sum += 5 * i
	if remain >= sum:
		if i == n:
			print(n)
			break
	else:
		print(i - 1)
		break


in1 = list(map(int, input().split(' ')))
problems = in1[0]
driveTime = in1[1]
Time = 240 - driveTime

def sumMinutes(n):
	return 5 * sum((x + 1 for x in range(n)))

def problemIter(p, t):
	for i in range(p):
		msum = sumMinutes(p - i)
		if msum <= t:
			return p - i
	return 0
print(problemIter(problems, Time))


(n, k) = map(int, input().split())
count = 0
x = 0
r = 0
left_time = 240 - k
for i in range(n):
	x = x + 5 * (i + 1)
	if x <= left_time:
		count = count + 1
print(count)


import math
import collections
import bisect

def arrPrint(a):
	return ' '.join([str(i) for i in a])

def gridPrint(a):
	return '\n'.join([' '.join([str(j) for j in a[i]]) for i in range(len(a))])

def isPalindrome(s):
	for i in range(len(s) // 2):
		if not s[i] == s[-i - 1]:
			return False
	return True

def primeCheck(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def solve(n, k):
	time = 0
	i = 1
	while time + k <= 240:
		time += 5 * i
		i += 1
	return min(i - 2, n)
(n, k) = list(map(int, input().split()))
result = solve(n, k)
print(result)


(m, n) = map(int, input().split())
a = []
for i in range(1, m + 1):
	a.append(5 * i)
c = 0
for i in a:
	if n + i <= 240:
		n += i
		c += 1
print(c)


z = list(map(int, input().split()))
timer = 240 - z[1]
count = 0
i = 1
while timer - 5 * i >= 0 and count < z[0]:
	count += 1
	timer -= 5 * i
	i += 1
print(count)


(a, b) = map(int, input().split())
c = 240 - b
s = 0
i = 1
while c > 0 and i <= a:
	if c - 5 * i >= 0:
		c -= 5 * i
		s += 1
	i += 1
print(s)


(n, p) = map(int, input().split())
p = 240 - p
while n >= 0:
	if p >= int(5 * n * (n + 1) / 2):
		print(n)
		exit()
	else:
		n -= 1


(num_tasks, time_to_party) = [int(i) for i in input().split(' ')]
time_for_one_task = 5
full_time = 4 * 60
time_for_tasks = full_time - time_to_party
solved_tasks = 0
while True:
	time_for_tasks -= (solved_tasks + 1) * time_for_one_task
	if time_for_tasks < 0 or solved_tasks >= num_tasks:
		print(solved_tasks)
		break
	solved_tasks += 1


(p, m) = map(int, input().split())
time = 240 - m
i = 0
solve = 0
while time > 0 and p > 0:
	i = i + 1
	time = time - i * 5
	if time < 0:
		solve = solve - 1
		p = p + 1
	solve = solve + 1
	p = p - 1
print(solve)


lst = list(map(int, input().strip().split(' ')))
n = lst[1]
m = lst[0]
x = 240 - n
count = 0
s = 0
for i in range(1, m + 1):
	k = i * 5
	s += k
	if s > x:
		break
	else:
		count += 1
print(count)


import sys
import math
import heapq
from collections import defaultdict, deque
input = sys.stdin.readline

def r():
	return int(input())

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

def rl():
	return list(map(int, input().split()))
(n, k) = rm()
k = 240 - k
i = 1
cnt = 0
while i < n + 1 and k > 0:
	if k - i * 5 >= 0:
		cnt += 1
		k -= i * 5
	i += 1
print(cnt)


all_minutes = 240
(tasks_count, walk_time) = [int(x) for x in input().split()]
time_left = all_minutes - walk_time
res = 0
for i in range(1, tasks_count + 1):
	time = i * 5
	if time_left - time >= 0:
		time_left -= time
		res += 1
print(res)


(n, k) = [int(x) for x in input().split(' ')]
print(min(n, int((-1 + (1 + 4 * 2 * int((240 - k) / 5)) ** (1 / 2)) / 2)))


(p, k) = map(int, input().split())
time = 240 - k
i = 0
for j in range(1, 101):
	i = i + 5 * j
	if i > time or j > p:
		break
print(j - 1)


(a, b) = map(int, input().split())
left = 240 - b
i = 1
aa = 0
while left - 5 * i >= 0:
	aa += 1
	left -= 5 * i
	i += 1
print(min(a, aa))


(n, k) = map(int, input().split(' '))
time_left = 240 - k
max_solved = 0
for i in range(1, n + 1):
	time_spent = 5 * i
	if time_left - time_spent >= 0:
		time_left -= time_spent
		max_solved += 1
print(max_solved)


(a, b) = [int(i) for i in input().split(' ')]
res = 240 - b
res1 = 5 * (a * (a + 1) / 2)
if res >= res1:
	print(a)
else:
	for i in range(1, a + 1):
		if res >= 5 * (i * (i + 1) // 2):
			pass
		else:
			print(i - 1)
			break


def predicate(mid):
	return (1 + mid) * (5 * mid / 2)
(n, k) = input().split(' ')
remaining_minutes = 240 - int(k)
(l, r) = (1, int(n))
while l <= r:
	mid = (l + r) // 2
	if predicate(mid) > remaining_minutes:
		r = mid - 1
	else:
		l = mid + 1
print(l - 1)


(n, k) = map(int, input().split())
remaining = 240 - k
counter = 0
lst = [5, 15, 30, 50, 75, 105, 140, 180, 225]
for x in range(min(n, len(lst))):
	if lst[x] <= remaining:
		counter += 1
	else:
		break
print(counter)


(n, x) = map(int, input().split())
for i in range(1, n + 1):
	if 5 * (i + 1) * i / 2 > 240 - x:
		print(i - 1)
		exit(0)
print(i)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
c = True
cnt = 0
(n, k) = invr()
t = 4 * 60 - k
for i in range(1, n + 1):
	t = t - i * 5
	if t >= 0:
		cnt += 1
		continue
	print(cnt)
	c = False
	break
if c:
	print(cnt)


(a, b) = [int(x) for x in input().split()]
time = 240 - b
ans = 0
while time and a:
	ans += 1
	a -= 1
	time -= ans * 5
	if time == 0:
		break
	elif time < 0:
		ans -= 1
		break
print(ans)


(x, y) = map(int, input().split())
z = 240 - y
d = 0
l = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
for i in range(len(l)):
	d += l[i]
	if d > z:
		print(min(x, i))
		break


(n, k) = map(int, input().split())
x = 240 - k
z = 0
sum = 0
while z <= n:
	if z == n:
		print(z)
		exit(0)
	sum = sum + 5 * (z + 1)
	if sum > x:
		print(z)
		exit(0)
	else:
		z = z + 1


import math
(n, k) = map(int, input().split())
r = 0
sum = 0
p = 0
if k >= 236:
	print(0)
else:
	d = 240 - k
	p = (math.sqrt(25 + 40 * d) - 5) // 10
	if p <= n:
		print(math.floor(p))
	else:
		print(n)


time = []
maxTime = 240

def fillTime():
	for i in range(1, 11):
		time.append(5 * sum(range(1, i + 1)))

def findMaxProblems(numOfProblems, timeToArrive):
	prevAmount = 0
	for i in range(len(time)):
		if time[i] + timeToArrive <= 240:
			prevAmount = i + 1
			if numOfProblems == i + 1:
				return i + 1
			continue
		if time[i] + timeToArrive > 240:
			return prevAmount
fillTime()
nums = input().split()
print(findMaxProblems(int(nums[0]), int(nums[1])))


def speshka(n, k):
	s = 240 - k
	count = 0
	for i in range(1, n + 1):
		if 5 * i <= s:
			s -= 5 * i
			count += 1
	return count
(N, K) = [int(i) for i in input().split()]
print(speshka(N, K))


[n, k] = [int(x) for x in input().split()]
time = 240 - k
problem = 0
while time > 0:
	if time < (problem + 1) * 5:
		break
	else:
		problem += 1
		time -= problem * 5
print(min(n, problem))


import math
(n, k) = [int(i) for i in input().split()]
time = (4 * 60 - k) / 5
print(int(min(n, (math.sqrt(1 + 8 * time) - 1) // 2)))


info = input()
problems = int(info.split(' ')[0])
travel_time = int(info.split(' ')[1])
total_time = 4 * 60
time_left = total_time - travel_time
problem_time = []
for i in range(problems):
	try:
		problem_time.append((i + 1) * 5 + problem_time[i - 1])
	except:
		problem_time.append((i + 1) * 5)
for i in range(len(problem_time)):
	if time_left - problem_time[i] < 0:
		print(i)
		break
	elif i + 1 == problems:
		print(i + 1)
	else:
		continue


(n, k) = map(int, input().split())
t = 4 * 60
r = t - k
qt = 0
a = 0
for i in range(1, n + 1):
	if qt + 5 * i <= r:
		qt = qt + 5 * i
		a = a + 1
	else:
		break
print(a)


(n, k) = map(int, input().split())
time_rem = 240 - k
count = 0
while time_rem - 5 * (count + 1) >= 0:
	count += 1
	time_rem -= 5 * count
print(min(n, count))


inp = list(map(int, input().split()))
(n, k) = (inp[0], inp[1])
minutesremaining = 240 - k
timespent = 0
solved = 0
for i in range(n):
	timespent += (i + 1) * 5
	if timespent <= minutesremaining:
		solved += 1
	else:
		break
print(solved)


[n, k] = [int(i) for i in input().split()]
res = 1
t = 240 - k
while 5 * res * (res + 1) / 2 <= t:
	res += 1
print(min(n, res - 1))


(n, k) = map(int, input().split())
while sum([5 * x for x in range(n + 1)]) > 240 - k:
	n -= 1
print(n)


(n, k) = [int(x) for x in input().split()]
min_avail = 240
min_avail -= k
prob_count = 0
for i in range(n):
	if min_avail >= 5 * (i + 1):
		min_avail -= 5 * (i + 1)
		prob_count += 1
	else:
		break
print(prob_count)


(N, K) = list((int(i) for i in input().split()))
freeTime = 240 - K
while N >= 0:
	requiredTime = 5 * (N * (N + 1) // 2)
	if requiredTime <= freeTime:
		print(N)
		exit(0)
	N -= 1


(n, k) = [int(i) for i in input().split()]
l = 240 - k
i = 0
j = 0
c = 0
while l >= 0 and c < n + 1:
	i = i + 1
	j = i * 5
	l = l - j
	c = c + 1
print(c - 1)


(n, m) = input().strip().split()[:2]
n = int(n)
m = int(m)
x = 1
s = 0
while s + m <= 240 and x <= n:
	s = s + x * 5
	if s + m > 240:
		x = x - 1
	p = x
	x += 1
print(p)


(x, y) = map(int, input().split())
count = 0
sum = y
for i in range(0, x):
	m = (i + 1) * 5
	if sum + m <= 240:
		sum += m
		count += 1
print(count)


a = [int(x) for x in input().split()]
total = 0
count = 0
for i in range(1, a[0] + 1):
	total = total + 5 * i
	if total + a[1] <= 240:
		count = count + 1
	else:
		break
print(count)


(a, b) = map(int, input().split())
b = 240 - b
i = 1
while 1:
	if int(5 / 2 * i * (i + 1)) > b or i == a + 1:
		print(i - 1)
		break
	i += 1


(x, y) = [int(i) for i in input().split(' ')]
while x * (x + 1) / 2 * 5 > 240 - y:
	x -= 1
print(x)


(n, k) = map(int, input().strip().split(' '))
total_time = 4 * 60 - k
s = 0
for i in range(1, n + 1):
	s += 5 * i
	if s > total_time:
		print(i - 1)
		break
if s <= total_time:
	print(n)


(n, k) = map(int, input().split())
t = 2.5 * n * (n + 1)
u = 5 * n
lt = 240 - int(t)
if lt >= k:
	print(n)
else:
	while lt < k:
		lt = lt + 5 * n
		n -= 1
	print(n)


(problem, time_need) = map(int, input().split())
remaining_time = 240 - time_need
c = 1
d = 0
while c <= problem:
	ith_problem = c * 5
	if remaining_time >= ith_problem:
		remaining_time = remaining_time - ith_problem
		d += 1
	c += 1
print(d)


from bisect import bisect_right
from itertools import accumulate
import operator
vals = input().split()
time = 240
(n, k) = (int(vals[0]), int(vals[1]))
remaining = time - k
arr = []
for i in range(1, n + 1):
	arr.append(i * 5)
add_arr = list(accumulate(arr, operator.add))
op = bisect_right(add_arr, remaining)
print(op)


(quest, time) = input().split()
quest = int(quest)
time = int(time)
time2 = 240 - time
n = 1
i = 0
while time2 > 0 and quest > 0:
	if n * 5 <= time2:
		time2 = time2 - n * 5
		i = i + 1
		quest = quest - 1
		n = n + 1
	else:
		break
print(i)


(s, t) = input().strip().split(' ')
(s, t) = [int(s), int(t)]
n = 0
k = 0
n = int(s)
k = int(t)
time = 4 * 60 - k
t = time % 5
t = time - t
sum = 0
i = 1
count = 0
while i <= n:
	sum = sum + 5 * i
	if sum <= t:
		count += 1
	i += 1
print(count)


(n, k) = map(int, input().split())
time = 4 * 60
time = time - k
problems = 0
while time >= (problems + 1) * 5:
	problems = problems + 1
	time = time - 5 * problems
	if problems == n:
		break
print(problems)


(z, m) = map(int, input().split())
i = 5
h = 240 - m
count = 0
while h - i >= 0:
	h = h - i
	i = i + 5
	count += 1
if count >= z:
	print(z)
else:
	print(count)


(n, k) = [int(x) for x in input().split()]
k = 240 - k
i = 1
sum = -1
while k >= 0:
	k -= i * 5
	i += 1
	sum += 1
print(min(sum, n))


n = input().split()
prob = int(n[0])
trav = 240 - int(n[1])
i = 1
while trav > 0 and prob:
	trav -= 5 * i
	i += 1
	prob -= 1
if trav < 0:
	print(i - 2)
else:
	print(i - 1)


n = input().split(' ')
n = list(map(int, n))
maxm = n[1]
for i in range(n[0]):
	maxm += 5 * (i + 1)
	if maxm <= 240:
		a = i + 1
	else:
		a = i
		break
print(a)


(n, k) = map(int, input().split())
time = 240
remaining = 240 - k
count = 0
for i in range(1, n + 1):
	j = 5 * i
	if j > remaining:
		break
	else:
		remaining = remaining - j
		count = count + 1
print(count)


(x, y) = map(int, input().split())
left = 0
right = x
time = 240 - y
while left < right:
	mid = (left + right + 1) // 2
	if (1 + mid) * mid // 2 * 5 > time:
		right = mid - 1
	else:
		left = mid
print(left)


while True:
	try:
		(n, k) = map(int, input().strip().split())
		temp = 5
		res = 0
		while k < 240:
			if k + temp <= 240 and n > 0:
				res += 1
				k += temp
				temp += 5
				n -= 1
			else:
				break
		print(res)
	except EOFError:
		break


(n, k) = [int(x) for x in input().split()]
a = 0
s = 240 - k
while s >= 0:
	s -= 5 * a
	a += 1
print(min(n, a - 2))


(n, k) = map(int, input().split())
min_left = 240 - k
l = []
for i in range(1, n + 1):
	l.append(5 * i)
count = 0
add = 0
for i in l:
	add += i
	if add <= min_left:
		count += 1
print(count)


(a, b) = map(int, input().split())
t = 0
f = True
for i in range(1, a + 1):
	t += i * 5
	if t > 240 - b and f:
		print(i - 1)
		f = False
if f:
	print(i)


a = input().split()
n = int(a[0])
k = int(a[1])
trem = 240 - k
i = 0

def newyear(ptime, trem):
	global i
	if ptime <= trem and i <= n:
		i += 1
		ptime = ptime + 5 * i
		newyear(ptime, trem)
	else:
		print(i - 1)
newyear(0, trem)


(n, k) = map(int, input().split())
t = 240 - k
s = 0
a = []
q = []
for i in range(1, n + 1):
	s += i * 5
	a.append(s)
for i in range(len(a)):
	if a[i] >= t:
		q.append(i + 1)
if s <= t:
	print(n)
elif len(q) == 0:
	print(0)
else:
	if t == a[q[0] - 1]:
		print(q[0])
	else:
		print(q[0] - 1)
	if s <= t:
		print(n)


(n, k) = map(int, input().split())
(all_possible, time) = (True, 0)
for i in range(1, n + 1):
	time += i * 5
	if time + k > 240:
		print(i - 1)
		all_possible = False
		break
if all_possible:
	print(n)


(n, k) = map(int, input().split())
a = list()
a.append(0)
for i in range(1, n + 1):
	a.append(a[i - 1] + 5 * i)
a.append(1000000)
for i in range(n + 2):
	if a[i] + k > 240:
		print(i - 1)
		break


(n, k) = input().split()
n = int(n)
k = int(k)
r = 240 - k
t = 0
j = 0
x = 0
c = 0
for i in range(n):
	j = j + 1
	t = t + j * 5
	if t > r:
		x = j - 1
		c = c + 1
		break
	elif t == r:
		c = c + 1
		x = j
		break
if x >= 0 and c == 1:
	print(x)
else:
	print(n)


def kol_re(n, m):
	minut = 240 - m
	k = 0
	for i in range(1, n + 1):
		if minut - 5 * i < 0:
			return k
		minut -= 5 * i
		k += 1
	return k
(n, m) = map(int, input().split())
print(kol_re(n, m))


(n, k) = map(int, input().split())
rem = 240 - k
ans = 0
i = 1
while rem and i <= n:
	if i * 5 <= rem:
		ans += 1
		rem -= 5 * i
	i += 1
print(ans)


s = list(map(int, input().split()))
(n, k, i) = (s[0], s[1], 1)
r = 240 - k
while r >= i * 5 and i <= n:
	r -= i * 5
	i += 1
print(i - 1)


l = list(map(int, input().rstrip().split()))
n = l[0]
t = l[1]
c = 0
s = 0
k = []
for i in range(n):
	s = s + 5
	k.append(s)
	x = sum(k)
	y = 240 - t
	if x <= y:
		c += 1
	else:
		break
print(c)


(a, b) = input().split()
a = int(a, 10)
b = int(b, 10)
i = 0
k = 240 - b

def f1(n):
	global i
	i = i + 1
	if n < i * 5:
		return 0
	if n >= i * 5:
		return 1 + f1(n - i * 5)
f = f1(k)
if f <= a:
	print(f)
else:
	print(a)


(n, k) = map(int, input().split())
time = 240 - k
pr = []
count = 0
for i in range(1, n + 1):
	pr.append(i)
for i in range(len(pr)):
	a = pr[i] * 5
	if time - a >= 0:
		time -= a
		count += 1
print(count)


(n, k) = map(int, input().split())
totale = 4 * 60
cont = 0
i = 0
totale -= k
while True:
	i += 1
	if totale - i * 5 >= 0 and n > 0:
		n -= 1
		totale = totale - i * 5
		cont += 1
	else:
		break
print(cont)


(q, k) = input().split()
(q, k) = (int(q), int(k))
time = (240 - k) / 5 * 2
n = 0
if time > 0:
	while n * n + n <= time and n <= 10:
		n += 1
	if n - 1 > q:
		n = q + 1
	print(n - 1)
else:
	print(0)


w = input().split()
tp = int(w[0])
tt = int(w[1])
i = 1
t = 0
while i <= tp:
	if t + 5 * i <= 240 - tt:
		t = t + 5 * i
		i += 1
	else:
		break
print(i - 1)


(n, k) = list(map(int, input().strip().split()))
cas = 240 - k
cnt = 0
i = 1
while i <= n:
	if 5 * i <= cas:
		cnt += 1
		cas -= 5 * i
	i = i + 1
print(cnt)


(n, k) = list(map(int, input().split()))
res = (240 - k) // 5
count = 1
while res - count >= 0:
	res -= count
	count += 1
print(min(n, count - 1))


(n, m) = [int(x) for x in input().split()]
time = 240 - m
i = 0
while time >= 0:
	i += 1
	time -= 5 * i
if i - 1 > n:
	print(n)
else:
	print(i - 1)


(n, k) = map(int, input().split())
t = 240 - k
sun = 0
count = 0
x = 5
if t > 0:
	while sun + 5 <= t:
		count += 1
		x += 5
		sun = sun + x
	if n >= count:
		print(count)
	else:
		print(n)
else:
	print(0)


import math
(n, k) = list(map(int, input().split()))
minutes = 240 - k
res = int((-5 + math.sqrt(25 + 40 * minutes)) / 10)
print(min(res, n))


def in_minutes(mid: int, k: int) -> int:
	flag: int = 5 * mid * (mid + 1) / 2 + k
	return flag

def binary(n: int, k: int) -> int:
	(low, high) = (0, n)
	mid = None
	while low <= high:
		mid: int = (low + high) // 2
		if in_minutes(mid, k) > 240:
			high = mid - 1
		elif in_minutes(mid, k) < 240 and in_minutes(mid + 1, k) <= 240:
			low = mid + 1
		else:
			break
	return mid
(n, k) = map(int, input().split())
print(binary(n, k))


(n, k) = map(int, input().split())
t = 240 - k
i = 5
d = 0
i1 = 1
while t >= i1 * i:
	t -= i * i1
	i1 += 1
	d += 1
if d > n:
	print(n)
else:
	print(d)


(n, m) = input().split()
n = int(n)
m = int(m)
left = 240 - m
for i in range(n, -1, -1):
	if i * (i + 1) // 2 * 5 <= left:
		print(i)
		break


(n, time) = list(map(int, input().split()))
solved = 0
e = 0
for i in range(1, n + 1):
	e += 5 * i
	if e + time <= 240:
		solved += 1
	else:
		break
print(solved)


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def solve(case_no):
	(n, m) = map(int, input().split())
	m = 240 - m
	for i in range(1, n + 1):
		if m < 5 * i:
			print(i - 1)
			exit()
		m -= 5 * i
	print(n)
t = 1
for i in range(1, t + 1):
	solve(i)


(x, y) = map(int, input().split())
s = 0
k = x
for i in range(1, x + 1):
	s += i * 5
	if s > 240 - y:
		k = i - 1
		break
print(k)


(n, t) = map(int, input().split())
r = 240 - t
(p, i, c) = (0, 1, 0)
while r >= p:
	p += 5 * i
	i += 1
	c += 1
if c <= n:
	print(c - 1)
else:
	print(n)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
(n, k) = mi()
rem = 240 - k
flag = 0
for i in range(1, n + 1):
	if rem < 5 * i:
		flag = 1
		break
	rem -= 5 * i
if flag == 1:
	print(i - 1)
else:
	print(i)


(n, k) = map(int, input().split())
left = 240
prob = 0
for i in range(1, n + 1):
	left -= 5 * i
	if left >= k:
		prob += 1
print(prob)


(n, k) = map(int, input().split())
m = 240 - k
s = 1
while m >= 5 * s:
	m = m - 5 * s
	s += 1
p = s - 1
print(min(p, n))


(N, K) = [int(i) for i in input().split()]
S1 = 240 - K
S2 = 0
for i in range(1, N + 1):
	if S2 + i * 5 > S1:
		print(i - 1)
		break
	else:
		S2 += i * 5
else:
	print(i)


(n, k) = [int(x) for x in input().split()]
limit = 240 - k
ans = 0
time = 0
low = 0
high = n + 1
while low < high:
	mid = low + (high - low >> 1)
	if mid == low:
		break
	score = 5 * (mid * (mid + 1) >> 1)
	if score > limit:
		high = mid
	elif score < limit:
		low = mid
	else:
		low = mid
		break
print(low)


(n, k) = map(int, input().strip().split(' '))
rt = 240 - k
st = 0
c = 0
for i in range(1, n + 1):
	st += i * 5
	if st > rt:
		break
	else:
		c += 1
print(c)


(x, y) = map(int, input().split())
z = 240 - y
s = 0
c = 0
for i in range(1, x + 1):
	s = s + 5 * i
	if s <= z:
		c += 1
print(c)


(a, b) = map(int, input().split())
l = []
lt = []
x = []
for i in range(1, a + 1):
	s = 5 * i
	l.append(s)
	c = b + sum(l)
	if c <= 240:
		lt.append(c)
		x.append(i)
if len(x) != 0:
	print(max(x))
elif len(x) == 0:
	print(0)


(n, k) = input().split()
n = int(n)
k = int(k)
pt = 240 - k
i = 1
su = 0
while i <= n:
	su = su + 5 * i
	if su > pt:
		i = i - 1
		break
	if su == pt or i >= n:
		break
	i = i + 1
print(i)


(problem, minute) = map(int, input().split())
total = 240
while problem >= 0:
	waste = total - (5 / 2 * (problem + 1) * problem + minute)
	if waste >= 0:
		print(problem)
		break
	else:
		problem -= 1


(n, k) = [int(x) for x in input().split()]
limit = 240 - k
ans = 0
time = 0
for i in range(1, n + 1):
	cost = 5 * i
	new = time + cost
	if new > limit:
		break
	time = new
	ans = i
print(ans)


line = input().split()
a = int(line[0])
b = int(line[1])
b = 240 - b
ans = 0
s = 0
for ans in range(1, a + 2):
	if s + 5 * ans > b:
		break
	s = s + 5 * ans
print(ans - 1)


(n, k) = map(int, input().split())
c = 0
s = 240 - k
g = 0
while c <= s and g <= n:
	g = g + 1
	c = c + 5 * g
print(g - 1)


import math
(n, k) = tuple(map(int, input().split(' ')))
if 240 - k < 5:
	print(0)
else:
	print(min(n, int(-1 + math.sqrt(1 + 8 * (240 - k) / 5)) // 2))


(num_problems, travel_time) = map(int, input().split())
time = 4 * 60 - travel_time
count = 0
for i in range(1, num_problems + 1):
	ptime = i * 5
	if ptime > time:
		break
	time -= ptime
	count += 1
print(count)


(n, k) = map(int, input().split())
if 1 <= n <= 10 and 1 <= k <= 240:
	m = 0
	i = 1
	sor = 240 - k
	while sor >= 0 and i <= n:
		resh = 5 * i
		sor -= resh
		if sor >= 0:
			i += 1
			m += 1
	print(m)


import sys
(n, k) = map(int, sys.stdin.readline().strip().split())
k = 240 - k
t = 0
result = 0
for i in range(1, n + 1):
	t += i * 5
	if t > k:
		break
	else:
		result = result + 1
print(result)


a = list(input().split())
n = int(a[0])
k = int(a[1])
t = 240 - k
sum = 0
i = 1
p = 0
while sum <= t:
	sum = sum + 5 * i
	i += 1
	if sum <= t:
		p += 1
if p <= n:
	print(p)
else:
	print(n)


(n, k) = input().split()
(n, k) = (int(n), int(k))
time_total_tasks = 0
tasks_able = 0
time_left = 4 * 60 - k
for i in range(1, n + 1):
	time_total_tasks += i * 5
	if time_total_tasks <= time_left:
		tasks_able += 1
	else:
		tasks_able += 0
		break
print(tasks_able)


import sys

def bins(arr, key):
	lo = 0
	hi = len(arr) - 1
	while lo < hi:
		mid = lo + (hi - lo) // 2
		if key > arr[mid]:
			lo = mid + 1
		else:
			hi = mid
	if arr[hi] == key:
		return hi
	return hi - 1
(n, k) = map(int, sys.stdin.readline().split())
tasks = [5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
print(min(bins(tasks, (240 - k) // 5 * 5) + 1, n))


(n, k) = map(int, input().split())
time = 240
remain = time - k
count = 0
x = 1
while remain > 0:
	if remain >= 5 * x:
		count += 1
	remain = remain - 5 * x
	x += 1
	if x > n:
		break
print(count)


(numProblems, timeToGo) = [int(x) for x in input().split()]
availableTime = 240 - timeToGo
i = 1
count = 0
while availableTime >= 0 and count <= numProblems:
	availableTime -= 5 * i
	i += 1
	count += 1
print(count - 1)


(t, pi) = map(int, input().split())
(l, r) = (1, t)
ans = 0
while l <= r:
	mid = l + (r - l) // 2
	if sum(range(1, mid + 1)) * 5 + pi <= 240:
		ans = mid
		l = mid + 1
	else:
		r = mid - 1
print(ans)


def solve(x, y):
	time = 240 - y
	problems = 0
	for i in range(x):
		if time - 5 * (i + 1) >= 0:
			time -= 5 * (i + 1)
			problems += 1
		else:
			break
	return problems
(n, k) = list(map(int, input().split()))
print(solve(n, k))


(p, t) = map(int, input().split())
c = 0
for i in range(1, p + 1):
	t = t + i * 5
	if t <= 240:
		c = c + 1
print(c)


(n, k) = list(map(int, input().split()))
start = 240 - k
i = 1
count = 0
while i <= n and start - 5 * i >= 0:
	count = count + 1
	start = start - 5 * i
	i = i + 1
print(count)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

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

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
(n, k) = sp()
rem = 240 - k
(i, answer) = (1, 0)
while rem > 0 and i <= n:
	if rem >= i * 5:
		answer += 1
		rem -= i * 5
	else:
		break
	i += 1
out(answer)


(n, k) = input().split()
n = int(n)
k = int(k)
dp = []
dp.append(5)
for i in range(1, n):
	dp.append(dp[i - 1] + 5 * (i + 1))
l = 0
r = n
while l < r:
	mid = l + (r - l) // 2
	if dp[mid] == 240 - k or (dp[mid] < 240 - k and mid + 1 < n and (dp[mid + 1] > 240 - k)):
		print(mid + 1)
		break
	elif dp[mid] < 240 - k:
		l = mid + 1
	else:
		r = mid
if l >= r:
	if dp[mid] <= 240 - k:
		print(mid + 1)
	else:
		print(mid)


(n, k) = [int(i) for i in input().split()]
ostatok = 240 - k
sum = 0
i = 0
while 1:
	sum += (i + 1) * 5
	if sum > ostatok or i == n:
		break
	i += 1
print(i)


(n, k) = map(int, input().split())
spend = n
time = 240 - k
count = 0
while time > 0:
	time -= 5 * (count + 1)
	count += 1
	if count >= n:
		break
print(count if time >= 0 else count - 1)


(a, b) = map(int, input().split())
c = 240 - b
d = 0
while c >= 5 * d and a > 0:
	c -= 5 * d
	if c >= 5 * (d + 1):
		d += 1
	a -= 1
print(d)


(n, m) = map(int, input().split())
ans = 0
t = 240 - m
timer = 5
while timer <= t and n > 0:
	ans += 1
	t -= timer
	timer += 5
	n -= 1
print(ans)


import bisect
(n, time) = map(int, input().split())
time = 240 - time
arr = [5]
for i in range(2, n + 1):
	arr.append(arr[-1] + 5 * i)
print(bisect.bisect_right(arr, time))


(n, k) = map(int, input().split())
req_time = int(5 * n * (n + 1) / 2)
time_left = 240 - k
if time_left >= req_time:
	print(n)
else:
	solved = 0
	i = 1
	while 1:
		if time_left >= 5 * i:
			solved += 1
			time_left -= 5 * i
			i += 1
		else:
			break
	print(solved)


def bi(lst, v):
	if len(lst) == 1:
		return lst[0]
	mid = len(lst) // 2
	if lst[mid] == v:
		return lst[mid]
	elif lst[mid] < v:
		return bi(lst[mid:], v)
	elif lst[mid] > v:
		return bi(lst[:mid], v)
(n, k) = [int(i) for i in input().split()]
a = [0]
for i in range(1, n + 1):
	a.append(a[-1] + 5 * i)
x = 240 - k
print(a.index(bi(a, x)))


a = list(map(int, input().strip().split()))[:2]
n = a[0]
k = a[1]
checkvalue = (480 - 2 * k) / 5
i = 1
while i * (i + 1) <= checkvalue and i <= n:
	i += 1
print(i - 1)


import math

def solve_quad(a, b, c):
	return [(-b + math.sqrt(b ** 2 - 4 * a * c)) / (2 * a), (-b - math.sqrt(b ** 2 - 4 * a * c)) / (2 * a)]
(n, k) = [int(a) for a in input().split(' ')]
print(min(int(math.floor(solve_quad(2.5, 2.5, k - 4 * 60)[0])), n))


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
(n, k) = get_ints()
l = 240 - k
count = 0
for i in range(1, n + 1):
	if 5 * i <= l:
		l = l - 5 * i
		count += 1
	else:
		break
print(count)


a = input().split()
t = 240 - int(a[1])
n = int(a[0])
l = 0
m = 0
while t > 0 and n != 0:
	n -= 1
	l += 5
	t -= l
	if not t < 0:
		m += 1
print(m)


(n, k) = map(int, input().split())
cost = 0
count = 0
flag = True
flag1 = True
for i in range(1, n + 1):
	if 240 - cost < k:
		print(count - 1)
		flag = False
		break
	else:
		cost += i * 5
		count += 1
if 240 - cost < k and flag == True:
	print(count - 1)
	flag1 = False
if flag == True and flag1 == True:
	print(count)


lst = list(map(int, input().split()))
(n, k) = (lst[0], lst[1])
hours = 240
count = 0
for i in range(1, n + 1):
	hours -= 5 * i
	count += 1
	if k > hours:
		count -= 1
		break
	elif k == hours:
		break
print(count)


(n, k) = input().split()
n = int(n)
k = int(k)
time = 240 - k
total = 0
i = 0
while total < time:
	if time - total < 5 * (i + 1):
		break
	else:
		i += 1
		total += 5 * i
if i <= n:
	print(i)
else:
	print(n)


def soma_pa(x):
	x = x + 1
	return (1 + x) * 5 * x / 2
(n, k) = map(int, input().split())
i = 0
while soma_pa(i) + k <= 240 and i < n:
	i += 1
print(i)


Linea = input()
L = Linea.split()
N = int(L[0])
T = int(L[1])
t = 240 - T
Contador = 0
Suma = 0
for k in range(N):
	Suma += 5 * (k + 1)
	if Suma > t:
		break
	else:
		Contador += 1
print(Contador)


(n, k) = [int(x) for x in input().split()]
(time_remaining, time_spent, problems_solved, i) = (240 - k, 0, 0, 1)
while time_remaining > time_spent:
	time_spent += 5 * i
	if time_remaining >= time_spent:
		problems_solved += 1
	i += 1
print(problems_solved if problems_solved < n else n)


(n, t) = input().split()
(n, t) = (int(n), int(t))
total_time = 240 - t
cnt = 0
time = 0
for i in range(1, 11):
	time += i * 5
	if time > total_time or i > n:
		break
	cnt += 1
print(cnt)


(n, k) = map(int, input().split())
i = 0
s = 0
v = 0
j = 0
while i < n and s / 60 + k / 60 <= 4:
	i += 1
	v = i * 5
	s = s + v
	if s / 60 + k / 60 <= 4:
		j += 1
print(j)


def main():
	s = input()
	lis = s.split()
	n = int(lis[0])
	k = int(lis[1])
	time = 240 - k
	cnt = 0
	ans = 0
	for i in range(1, n + 1):
		cnt += i * 5
		if cnt <= time:
			ans = i
		else:
			break
	print(ans)
main()


def ab():
	(b, c) = map(int, input().split())
	t = 240 - c
	k = 0
	for i in range(1, b + 1):
		r = 5 * i
		if t >= r:
			t = t - r
			k += 1
		else:
			print(k)
			return
	print(k)
ab()


(n, k) = map(int, input().split())
l = 0
r = n + 1
while r - l > 1:
	m = (r + l) // 2
	if 5 * m * (m + 1) // 2 + k <= 240:
		l = m
	else:
		r = m
print(l)


(n, k) = map(int, input().split())
time = 240 - k

def solved_problem(t):
	i = 1
	while 1:
		if t - 5 * i < 0:
			break
		t = t - 5 * i
		i += 1
	return i
x = solved_problem(time) - 1
if x > n:
	x = n
print(x)


import sys, math
(n, k) = map(int, sys.stdin.readline().split())
total = (240 - k) // 5
a = (int(math.sqrt(8 * total + 1)) - 1) // 2
print(min(n, a))


from sys import stdin
l = stdin.readline().rstrip('\n')
(n, k) = l.split(' ')
curr = 0
ans = 0
while curr + (ans + 1) * 5 <= 240 - int(k):
	curr += (ans + 1) * 5
	ans += 1
print(min(ans, int(n)))


import sys
input = sys.stdin.readline

def main():
	(n, k) = map(int, input().split())
	h = 4 * 60 - k
	f = lambda i: 5 * (i * (i + 1)) // 2

	def bs(l, r, v):
		while l <= r:
			m = (l + r) // 2
			i = f(m)
			if i == v:
				return m
			elif i < v:
				l = m + 1
			else:
				r = m - 1
		return r
	print(bs(1, n, h))
main()


(N, K) = [int(i) for i in input().split()]
i = 1
tot = 240 - K - 5 * i
while tot >= 0 and i <= N:
	i += 1
	tot -= 5 * i
print(i - 1)


(n, k) = list(map(int, input().split()))
tm = 4 * 60 - k
p = 0
for i in range(1, n + 1):
	tm -= 5 * i
	if tm >= 0:
		p += 1
	else:
		break
print(p)


listy = input().split()
listy = [int(x) for x in listy]
n = listy[0]
k = listy[1]
left = 60 * 4 - k
xxx = 0
i = 1
while left >= 0 and i <= n:
	left -= i * 5
	if left >= 0:
		xxx += 1
	i += 1
if left > 0 and i < n:
	xxx = n
print(xxx)


def problemSolved():
	(n, k) = map(int, input().split())
	k = 240 - k
	solved_time = 0
	for i in range(1, n + 1):
		solved_time = solved_time + 5 * i
		if solved_time > k:
			count = i - 1
			return count
		elif solved_time == k:
			count = i
			return count
	else:
		count = n
		return count
print(problemSolved())


def NewYear():
	(n, k) = list(map(int, input().split()))
	timeToCode = 240 - k
	problemsSolved = 0
	for i in range(1, n + 1):
		if i * 5 > timeToCode:
			break
		else:
			problemsSolved += 1
			timeToCode -= 5 * i
	print(problemsSolved)
NewYear()


[n, k] = list(map(int, input().split()))
t = 240 - k
p = 0
while 5 * p * (p + 1) / 2 <= t:
	p += 1
print(min(p - 1, n))


(n, k) = map(int, input().split())
r = 240 - k
s = 0
p = 0
max = 5 * n * (n + 1) / 2
if r >= max:
	p = n
else:
	for j in range(1, n + 1):
		s = 5 * j * (j + 1) / 2
		if r < s:
			p = j - 1
			break
		elif r == s:
			p = j
			break
print(p)


import math
(n, k) = list(map(int, input().split()))
t = (240 - k) // 5
s = (2 * 5 + (t - 1) * 5) * t // 2
while s > 240 - k:
	s = s - (5 + (t - 1) * 5)
	t = t - 1
if t > n:
	print(n)
else:
	print(t)


(n, t) = list(map(int, input().strip().split()))
c = 240
k = 0
for i in range(1, n + 1):
	b = 5 * i
	c = c - b
	if c < t:
		print(k)
		break
	else:
		k += 1
else:
	print(n)


import sys
import math
sys.setrecursionlimit(5000000)

def read(type=int):
	return type(input())

def read_arr(type=int):
	return [type(token) for token in input().split()]

def abs(num):
	return num if num > 0 else -num
(n, k) = read_arr()
a = 2 * (240 - k) // 5
b = int(math.sqrt(a))
while b * (b + 1) > a:
	b -= 1
print(min(b, n))


(n, m) = map(int, input().split())
x = 240 - m
c = 0
for i in range(1, n + 1):
	y = 5 * i
	if y <= x:
		x -= y
		c += 1
	else:
		break
print(c)


(n, k) = list(map(int, input().split()))
solved_problem_count = 0
timeHeHas = 60 * 4 - k
i = 1
while i <= n and timeHeHas > 0:
	if timeHeHas - 5 * i >= 0:
		timeHeHas -= 5 * i
		i += 1
		solved_problem_count += 1
	else:
		break
print(solved_problem_count)


(n, k) = input().split()
n = eval(n)
time = 240
time -= eval(k)
ans = 0
flag = False
for i in range(n + 1):
	ans += i * 5
	if ans > time:
		flag = True
		break
k = i
if flag:
	k -= 1
print(k)


(n, k) = map(int, input().split())
rem = 240 - k
tot = 0
for i in range(1, n + 1):
	tot += 5 * i
	if tot > rem:
		print(i - 1)
		exit()
print(n)


(n, k) = map(int, input().split())
time = 240 - k
solve = 0
a = 0
for i in range(n):
	solve += 5 * (i + 1)
	if solve > time:
		break
	a = i + 1
print(a)


def f(x):
	t = 0
	for i in range(11):
		t += i * 5
		if x < t:
			return i - 1
(n, k) = map(int, input().split())
print(min(n, f(240 - k)))


n_k = list(map(int, input().split()))
n = n_k[0]
k = n_k[1]
ostatok = 240 - k
res = 0
i = 1
while ostatok - i * 5 >= 0 and i <= n:
	ostatok -= i * 5
	i += 1
	res += 1
print(res)


(x, y) = map(int, input().split())
time_remain = 240
time = time_remain - y
problems = 0
time_problem = 5
while time > 0:
	time -= time_problem
	time_problem += 5
	if time < 0:
		break
	problems += 1
if problems > x:
	print(x)
else:
	print(problems)


from sys import stdin

def binarySearch(accTime, avaTime):
	if len(accTime) == 1:
		if accTime[0] <= avaTime:
			return 1
		else:
			return 0
	(minPoint, maxPoint) = (0, len(accTime) - 1)
	while minPoint <= maxPoint:
		midPoint = (minPoint + maxPoint) // 2
		if accTime[midPoint] <= avaTime:
			if midPoint == maxPoint:
				return midPoint + 1
			elif accTime[midPoint + 1] > avaTime:
				return midPoint + 1
			else:
				minPoint = midPoint + 1
		else:
			maxPoint = midPoint - 1
	return 0

def accumulatedTime(n):
	accTime = []
	for i in range(1, n + 1):
		if i == 1:
			time = 5 * i
			accTime.append(time)
		else:
			time = accTime[-1] + 5 * i
			accTime.append(time)
	return accTime

def main():
	(n, k) = stdin.readline().split()
	avaTime = 4 * 60 - int(k)
	accTime = accumulatedTime(int(n))
	rta = binarySearch(accTime, avaTime)
	print(rta)
main()


(n, k) = list(map(int, input().split()))
time = 240
diff = time - k
t = 0
prob = 0
for i in range(1, n + 1):
	if t + 5 * i <= diff:
		t = t + 5 * i
		prob += 1
print(prob)


(n, m) = map(int, input().split())
mn = 4 * 60
mn -= m
p = 0
for x in range(1, n + 1):
	if mn - x * 5 >= 0:
		mn -= x * 5
		p += 1
	else:
		break
print(p)


import math
input_args = input().split(' ')
n = int(input_args[0])
k = int(input_args[1])
prob_time = 240 - k
count = int((math.sqrt(1 + 8 * prob_time / 5) - 1) / 2)
if count > n:
	print(n, '\n')
else:
	print(count, '\n')


(n, k) = map(int, input().split())
a = 14400 - k * 60
c = 0
i = 1
total = 0
while True:
	total += i * 5
	if total * 60 <= a:
		c += 1
		i += 1
	else:
		break
if c < n:
	print(c)
else:
	print(n)


(n, k) = [int(x) for x in input().split()]
time = 240 - k
use = 0
d = 0
for i in range(1, n + 1):
	use += 5 * i
	if use > time:
		break
	d += 1
print(d)


i = 1

def dynamic(sum, mul):
	global i
	if sum < i * 5 or i > mul:
		return i
	else:
		i = i + 1
		dynamic(sum - (i - 1) * 5, mul)
	return i
(n, k) = list(map(int, input().strip().split()))
print(dynamic(240 - k, n) - 1)


(n, k) = map(int, input().split())
a = [5 * (i + 1) * (i + 2) // 2 for i in range(n)]
t = 240 - k
ng = n
ok = -1
while abs(ok - ng) > 1:
	mid = (ok + ng) // 2
	if a[mid] <= t:
		ok = mid
	else:
		ng = mid
print(ok + 1)


def main():
	(n, k) = list(map(int, input().split()))
	total = 0
	for i in range(n):
		total += 5 * (i + 1)
		if total + k > 240:
			return i
	return n
print(main())


(n, k) = map(lambda x: int(x), input().split(' '))
q = (240 - k) // 5 * 2
a = int(q ** 0.5)
if a * (a + 1) > q:
	a -= 1
print(min(a, n))


def how_many_tasks(n, time):
	res_time = 0
	for i in range(1, n + 1):
		if res_time + i * 5 > time:
			return i - 1
		else:
			res_time += 5 * i
	return n
(n, m) = (int(i) for i in input().split())
print(how_many_tasks(n, 60 * 4 - m))


List = list(map(int, input().strip().split()))[0:2]
probNo = List[0]
delTime = List[1]
TimeGranted = 4 * 60 - delTime
CumulativeTimeList = []
Sum = 0
j = 1
bool_stop = False
for k in range(1, probNo + 1):
	Sum = Sum + 5 * k
	if Sum > TimeGranted:
		bool_stop = True
		break
if bool_stop:
	print(k - 1)
else:
	print(probNo)


(n, k) = [int(el) for el in input().split(' ')]
S = 4 * 60
r = k + 5
i = 1
while r <= S and i <= n:
	i += 1
	r += i * 5
print(i - 1)


(n, t) = map(int, input().split())
Total_problem_solved = 0
sum = 0
if t > 235:
	Total_problem_solved = 0
else:
	remain = 240 - t
	for i in range(1, n + 1, 1):
		sum = sum + i * 5
		if sum <= remain:
			Total_problem_solved += 1
		else:
			break
print(Total_problem_solved)


(x, y) = list(map(int, input().split()))
y1 = 240 - y
s = 0
i = 1
j = 0
while s <= y1:
	s = 5 * i + s
	if s <= y1:
		j = j + 1
	if j == x:
		break
	i = i + 1
print(j)


n = list(map(int, input().split(' ')))
problem = n[0]
time = n[1]
have_time = 240
need_time = have_time - time
count = 0
c = 0
for i in range(1, problem + 1):
	c = c + i * 5
	if c <= need_time:
		count += 1
print(count)


(n, k) = map(int, input().split())
t = n
res = 0
while t > 0:
	time = int(5 * ((t ** 2 + t) / 2) + k)
	if time <= 240:
		res = t
		break
	t -= 1
print(res)


(n, k) = map(int, input().split())
c = 240 - k
e = 10
for i in range(1, 11):
	m = 5 * i * (i + 1) / 2
	if m > c:
		e = i - 1
		break
e = min(e, n)
print(e)


def compute_problem_time(problems):
	return 5 * (problems * (problems + 1)) // 2
(num_problems, travel_time) = map(int, input().split())
time_left = 4 * 60
problems_solved = 0
while True:
	solving_time = compute_problem_time(problems_solved + 1)
	if time_left - solving_time - travel_time < 0:
		break
	problems_solved += 1
	if problems_solved == num_problems:
		break
print(problems_solved)


(n, k) = list(map(int, input().split()))
t = 240 - k
s = 0
while t > 0 and s < n:
	s += 1
	t -= 5 * s
if t < 0:
	s -= 1
print(s)


def solution():
	(n, k) = (int(x) for x in input().split(' '))
	res = 0
	time = k
	for i in range(1, n + 1):
		if time + i * 5 <= 240:
			time += i * 5
			res += 1
		else:
			break
	print(res)
solution()


(n, t) = map(int, input().split())
p = [i * 5 for i in range(1, 11)]
rem = 240 - t
cnt = 0
for i in range(n):
	if rem >= p[i]:
		cnt += 1
		rem -= p[i]
print(cnt)


(n, k) = map(int, input().split())
t = 240 - k
T = 0
for i in range(1, n + 1):
	T += 5 * i
	if T > t:
		print(i - 1)
		quit()
print(n)


nk = input()
(n, k) = (int(i) for i in nk.split())
count = 0
probTime = 240 - k
for i in range(1, n + 1):
	if probTime >= 5 * i:
		probTime -= 5 * i
		count += 1
print(count)


(a, b) = [int(i) for i in input().split()]
sum = b
c = k = 0
for i in range(a):
	c += 1
	if 240 >= sum + c * 5:
		sum += c * 5
		k += 1
	else:
		break
print(k)


n = 0
k = 9873
i = 0
suma = 0
res = 0
c = 0
arr = [0] * 99
while k == 9873:
	arr = list(map(int, input().split()))
	n = arr[0]
	k = arr[1]
	res = 240 - k
	suma = 0
	c = 0
	for i in range(1, n + 1):
		suma += 5 * i
		if suma > res:
			break
		c = c + 1
	print(c)


(a, b) = map(int, input().split())
i = 1
c = 0
m = 0
while i <= a:
	c = c + i * 5
	d = c + b
	if d > 240:
		m = 1
		print(i - 1)
		break
	i = i + 1
if m == 0:
	print(i - 1)


(n, k) = map(int, input().split())
timeleft = 240 - k
ps = 0
_sum = 0
for i in range(n):
	_sum += 5 * (i + 1)
	if _sum <= timeleft:
		ps += 1
	else:
		break
print(ps)


(n, k) = map(int, input().split())
h = 240 - k
f = 0
m = [5, 15, 30, 50, 75, 105, 140, 180, 225, 275]
for i in range(n):
	if m[i] > h:
		print(i)
		break
	else:
		f += 1
if f == n:
	print(n)


import sys
input = sys.stdin.readline
(n, k) = map(int, input().split())
time = 240 - k
ans = 0
diff = 5
while time >= 0:
	if time - diff >= 0:
		time -= diff
		ans += 1
		diff += 5
	else:
		break
print(min(ans, n))


(n, k) = list(map(int, input().split()))
somme = 0
i = 1
while somme + 5 * i <= 4 * 60 - k and i <= n:
	somme += 5 * i
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
k = 4 * 60 - k
rs = 0
for i in range(400):
	x = 5 * (1 + i) * i
	x = x // 2
	if x > k:
		break
	rs = i
rs = min(rs, n)
print(rs)


(prop, tim) = list(map(int, input().split(' ')))
tim = 240 - tim
count = 0
while True:
	if tim < 0 or prop < 0:
		count -= 1
		break
	prop -= 1
	count += 1
	tim -= 5 * count
print(count)


import math
(n, k) = [int(x) for x in input().strip().split()]
c = (240 - k) * 2 / 5
c = -c
det = 1 - 4 * c
i = (-1 + math.sqrt(det)) / 2
j = int(i)
for i in range(11):
	if j * (j + 1) > -c:
		j += 1
	else:
		break
print(min(j, n))


z = input
(n, k) = map(int, z().split())
total = (12 - 8) * 60 - k
i = 0
while True:
	if total < 0:
		print(min(n, i - 1))
		break
	if total == 0:
		print(min(n, i))
		break
	i += 1
	total -= i * 5


(m, n) = map(int, input().split())
s = 240 - n
if 5 * (m + 1) * m / 2 <= s:
	print(m)
for i in range(1, m + 1):
	if 5 * (i + 1) * i / 2 > s:
		print(i - 1)
		break


def f(i):
	return i * (i + 1) / 2 * 5
(n, k) = map(int, input().split())
(low, mid, hi) = (0, 0, n)
while low < hi:
	mid = (low + hi) // 2
	time = 240 - f(mid)
	can = time - k >= 0
	if not can:
		hi = mid
	else:
		low = mid + 1
if 240 - f(low) - k >= 0:
	print(low)
else:
	print(low - 1)


(n, k) = map(int, input().split(' '))
time = 240 - k
t = 5
p = 0
while time - t >= 0 and p < n:
	time -= t
	p += 1
	t += 5
print(p)


import math
(n, k) = map(int, input().split(' '))
c = (480 - 2 * k) / 5
D = 1 + 4 * c
D = math.sqrt(D)
Ans = (D - 1) / 2
if Ans > n:
	print(n)
else:
	print(int(Ans))


import math
(n, k) = input().split()
n = int(n)
k = int(k)
x = (-5 + int(math.sqrt(25 + 40 * (240 - k)))) // 10
if x <= n:
	print(x)
else:
	print(n)


def answer():
	a = input().split()
	(n, k) = (int(a[0]), int(a[1]))
	timeleft = 240 - k
	ans = 0
	i = 1
	while n > 0 and timeleft - 5 * i >= 0:
		ans += 1
		n -= 1
		timeleft -= 5 * i
		i += 1
	return ans
print(answer())


(n, k) = input().split()
n = int(n)
k = int(k)
specialRatio = (240 - k) / 2.5
result = 0
for i in range(n, -1, -1):
	if i * (i + 1) <= specialRatio:
		result = i
		break
print(result)


(x, y) = map(int, input().split())
c = 0
for i in range(1, x + 2):
	c = c + i * 5
	if c + y > 240:
		print(i - 1)
		break
if c + y < 240:
	print(x)


(n, k) = map(int, input().split())
rm = 240 - k
et = 0
ans = 0
f = 0
for i in range(1, n + 1):
	et += i * 5
	if et > rm:
		ans = i - 1
		f = 1
		break
if f == 1:
	print(ans)
else:
	print(n)


(p, t) = map(int, input().split())
a = t + p * (p + 1) // 2 * 5
while a > 240:
	a = a - p * 5
	p -= 1
print(p)


(x, y) = [int(a) for a in input().split()]
z = 240 - y
s = 0
a = 0
for i in range(1, x + 1):
	s += 5 * i
	if s > z:
		break
	a += 1
print(a)


x = [int(y) for y in input().split()]
i = 1
x[1] = 240 - x[1]
while True:
	x[1] = x[1] - i * 5
	x[0] -= 1
	if x[1] < 0 or x[0] < 0:
		break
	i += 1
print(i - 1)


from math import sqrt

def sol1(n, k):
	t = (240 - k) // 5
	if t > n * (n + 1) / 2:
		return n
	t = 2 * t
	return int((-1 + sqrt(1 + 4 * t)) / 2)
(n, k) = map(int, input().split())
print(sol1(n, k))


(n, k) = map(int, input().split())
time = 240
total = 0
time = time - k
for i in range(n + 1):
	total += 5 * (i + 1)
	if total > time:
		print(i)
		break
if i == n and total < time:
	print(i)


l = input().split()
a = int((240 - int(l[1])) / 5)
i = 0
answer = 0
while a >= 0:
	i += 1
	a -= i
print(l[0] if int(l[0]) < i - 1 else i - 1)


(n, k) = map(int, input().split())
time = 240 - k
minu = 0
solve = 0
for i in range(1, n + 1):
	x = i * 5
	minu += x
	if minu <= time:
		solve += 1
	else:
		break
print(solve)


def que(n, k):
	(j, count) = (0, 0)
	for i in range(1, n + 1):
		j += 5 * i
		if j + k <= 240:
			count += 1
		else:
			break
	return count
(n, k) = map(int, input().split())
print(que(n, k))


(n, k) = map(int, input().split())
v = 240 - k
c = 0
i = 1
while v > 0 and i <= n:
	m = 5 * i
	if v - m >= 0:
		v = v - m
		c = c + 1
	i = i + 1
print(c)


(n, p) = map(int, input().split())
s = 0
t = 240 - p
c = 0
for i in range(n):
	s = s + 5 * (i + 1)
	if s <= t:
		c = c + 1
	elif s > t:
		break
print(c)


import math

def BuubleSort(a, b):
	b = 240 - b
	time = 5
	sol = 0
	while time <= b and sol < a:
		sol += 1
		b -= time
		time += 5
	return sol

def main():
	(a, b) = map(int, input().split())
	ans = BuubleSort(a, b)
	print(ans)
main()


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi
import heapq

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def main():
	try:
		(n, k) = In()
		k = 240 - k
		i = 0
		k = k // 5
		for i in range(1, 100):
			if i * (i + 1) // 2 > k:
				break
		if i > n:
			print(n)
		else:
			print(i - 1)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()


l = list(map(int, input().split()))
n = l[0]
k = l[1]
sh = 0
i = 0
p = 240 - k
while True:
	i += 1
	p -= i * 5
	if p >= 0:
		sh += 1
	else:
		break
if sh > n:
	print(n)
else:
	print(sh)


(n, k) = map(int, input().split())
x = 240 - k
l = []
s = 0
for i in range(1, n + 1):
	s += 5 * i
	l.append(s)
if x >= l[-1]:
	print(n)
	exit(0)
for i in range(n):
	if l[i] > x:
		print(i)
		break
	if l[i] == x:
		print(i + 1)
		break


(n, k) = [int(i) for i in input().split()]
time = 240 - k
score = 0
count = 0
while score < time:
	count += 1
	score += 5 * count
if score > time:
	count -= 1
if count > n:
	count = n
print(count)


import math
(n, k) = (int(i) for i in input().split())
val = 240 - k
val = 2 * val / 5
val = (math.sqrt(1 + 4 * val) - 1) / 2
val = int(val)
if val >= n:
	print(n)
else:
	print(val)


(n, k) = input().split(' ')
i = 1
res = 240 - int(k)
sum = 0
c = 0
while i <= int(n):
	sum += 5 * i
	if sum > res:
		break
	c += 1
	i += 1
print(c)


def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
import collections as c

def solve():
	(N, K) = getInts()
	T = 240 - K
	i = 1
	ans = 0
	while True:
		if 5 * i > T or i > N:
			return ans
		ans += 1
		T -= 5 * i
		i += 1
ans = solve()
print(ans)


def main():
	(n, k) = map(int, input().split())
	t = 240 - k
	cnt = 0
	while t >= 0 and cnt <= n:
		cnt += 1
		t -= cnt * 5
	print(cnt - 1)
main()


(n, k) = map(int, input().split())
i = 1
s = 5
while i <= n:
	if 240 - k < s:
		break
	s += (i + 1) * 5
	i += 1
print(i - 1)


(n, k) = map(int, input().split())
tol = 240
tol -= k
tsum = 0
psol = 0
for i in range(1, n + 1):
	tsum += 5 * i
	if tsum > tol:
		psol = i - 1
		break
	if tsum == tol:
		psol = i
		break
	if i == n:
		psol = n
print(psol)


data = input().split()
(N, K) = (int(data[0]), int(data[1]))
All_time = 240
aval_time = All_time - K
ans = j = 0
while aval_time >= j:
	ans += 1
	j += 5 * ans
	if ans - 1 == N:
		break
print(ans - 1)


(n, k) = map(int, input().split())
(time_limit, time, count) = (240, 0, 0)
while time + (count + 1) * 5 <= time_limit - k and count != n:
	count += 1
	time += count * 5
print(count)


(n, k) = list(map(int, input().split()))
t = 240 - k
c = 0
for x in range(n):
	if t - (x + 1) * 5 >= 0:
		t -= (x + 1) * 5
		c += 1
	else:
		break
print(c)


(n, k) = input().split()
(n, k) = (int(n), int(k))
t = 240 - k
v = 0
for i in range(1, n + 1):
	if t - 5 * i > 0 or t - 5 * i == 0:
		v += 1
		t -= 5 * i
print(v)


(a, b) = map(int, input().split(' '))
k = 240 - b
i = 1
s = 0
l = []
while s < 240:
	s += i * 5
	l.append(s)
	i += 1
for i in range(10):
	if l[i] > k:
		break
print(min(i, a))


s = input()
list = s.split()
n = int(list[0])
k = int(list[1])
k = 240 - k
i = 0
while k >= 0:
	i += 1
	k -= 5 * i
if k < 0:
	i -= 1
if i > n:
	i = n
print(i)


(n, k) = map(int, input().split())
t = 240 - k
(l, h) = (0, n)
i = 1
while i <= n:
	if 5 * i > t:
		break
	t -= 5 * i
	i += 1
print(str(i - 1))


(n, k) = [int(c) for c in input().split()]
max_time = 4 * 60 - k
time = 0
ans = 0
for i in range(1, n + 1):
	time += i * 5
	if time <= max_time:
		ans += 1
print(ans)


import math
(a, b) = map(int, input().split())
c = 240 - b
i = 0
while c >= 5 * (i + 1):
	i += 1
	c -= 5 * i
	if i == a:
		break
print(i)


from sys import stdin
import math
(n, k) = map(int, stdin.readline().rstrip().split(' '))
mins_left = 240 - k
count = 1
t = 0
while True:
	cur = count * 5
	if cur > mins_left or n == 0:
		break
	else:
		mins_left -= cur
		n -= 1
		count += 1
		t += 1
print(t)


(n, k) = map(int, input().split())
x = 0
for i in range(1, n + 1):
	a = 5 * i
	x = x + a
	if (x + k) // 240 == 1 and (x + k) % 240 == 0:
		print(i)
		break
	elif (x + k) // 240 == 1:
		print(i - 1)
		break
	elif 2.5 * (n * (n + 1)) + k < 240:
		print(n)
		break


(n, k) = map(int, input().split())
cache = [0] * (n + 1)
for i in range(1, n + 1):
	cache[i] = cache[i - 1] + i * 5
left = 1
right = n
while left < right:
	middle = (left + right) // 2
	if cache[middle] + k == 240:
		print(middle)
		quit()
	elif cache[middle] + k < 240:
		left = middle + 1
	else:
		right = middle - 1
print(left) if cache[left] + k <= 240 else print(left - 1)


(a, b) = map(int, input().split())
k = 0
m = 240
g = m - b
for i in range(1, a + 1):
	g = g - 5 * i
	if g >= 0:
		k += 1
print(k)


(n, k) = list(map(int, input().split()))
a = 240 - k
i = 1
x = 0
while i <= n and a - 5 * i >= 0:
	x = x + 1
	a = a - 5 * i
	i = i + 1
print(x)


from math import ceil
(n, k) = map(int, input().split())
k = 240 - k
i = 1
s = 0
c = 0
while s <= k:
	s = s + i * 5
	i += 1
	c += 1
if c > n:
	print(n)
else:
	print(c - 1)


(n, k) = map(int, input().split())
r = 240 - k
if r < 5:
	print(0)
elif 5 * n * (n + 1) / 2 <= r:
	print(n)
else:
	for i in range(n):
		if 5 * (i + 1) * (i + 2) / 2 > r:
			print(i)
			break


(n, k) = map(int, input().split())
(x, sm, cnt) = (240 - k, 0, 0)
for i in range(1, n + 1):
	if sm + i * 5 <= x:
		sm += i * 5
		cnt += 1
	else:
		break
print(cnt)


array = list(map(int, input().split()))
(n, k) = (array[0], array[1])
t = 240 - k
low = 0
high = n
answer = 0
while low <= high:
	mid = (low + high) // 2
	summ = 5 * (mid * (mid + 1) // 2)
	if summ <= t:
		if answer < mid:
			answer = mid
		low = mid + 1
	else:
		high = mid - 1
print(answer)


import sys
stdin = sys.stdin.read().splitlines()
(n, k) = map(int, stdin[0].split())
x = (int((8 * ((240 - k) // 5) + 1) ** (1 / 2.0)) - 1) / 2
if x > n:
	print(n)
else:
	print(int(x))


(n, x) = input().split()
(n, x) = (int(n), int(x))
val1 = n * (n + 1) / 2 * 5
if val1 <= 240 - x:
	print(n)
	exit()
else:
	res = 0
	val2 = 240 - x
	count = 0
	while count <= val2:
		count += 5
		if count <= val2:
			val2 -= count
			res += 1
print(res)


inputs = input()
the_list = list(map(int, inputs.split()))
n = the_list[0]
k = the_list[1]
time = 0
for i in range(1, n + 1):
	time = time + i * 5
	if time + k > 240:
		print(i - 1)
		break
	elif time + k == 240:
		print(i)
		break
if time + k < 240:
	print(i)


(n, k) = map(int, input().split())
l = 4 * 60 - k
sol = 0
if l >= 5:
	for i in range(1, n + 1):
		if 5 * i <= l:
			sol += 1
			l -= 5 * i
		else:
			break
print(sol)


(n, k) = map(int, input().split())
time_avl = 240 - k
time_req = [5 * i for i in range(1, n + 1)]
count = 0
sums = 0
for i in range(n):
	sums += time_req[i]
	if sums <= time_avl:
		count += 1
	else:
		break
print(count)


l = list(map(int, input().split()))
n = l[0]
k = l[1]
minutes = 240 - k
l = []
for i in range(0, n + 1):
	l.append(5 * (i * (i + 1)) // 2)
c = 0
for i in range(n, 0, -1):
	if l[i] <= minutes:
		print(i)
		c = 1
		break
if c == 0:
	print(0)


(n, k) = map(int, input().split())
time = 60 * 4 - k
p = 0
i = 1
while n and time - i * 5 >= 0:
	time -= i * 5
	p += 1
	i += 1
	n -= 1
print(p)


(a, b) = map(int, input().split())
s = 0
for i in range(a):
	s = s + 5 * (i + 1)
	if 240 - s < b:
		break
if i == a - 1 and 240 - s >= b:
	print(a)
else:
	print(i)


(a, b) = list(map(int, input().split()))
munn = 240 - b
k = 1
while munn > 0 and k != a + 1:
	munn = munn - 5 * k
	if munn < 0:
		k -= 1
	k += 1
print(k - 1)


(n, k) = input().split()
n = int(n)
k = int(k)
reste = 240 - k
resultat = 0
for i in range(1, n + 1):
	temps = i * 5
	if reste >= temps:
		resultat = resultat + 1
		reste = reste - temps
print(resultat)


(n, p) = [int(__) for __ in input().strip().split()]
p = 4 * 60 - p
k = 1
while k * (k + 1) <= p * 0.4:
	k += 1
print(min(k if k * (k + 1) <= p * 0.4 else k - 1, n))


(k, num) = input().split()
k = int(k)
num = int(num)
num = 240 - num
count = 0
total = 0
for i in range(1, k + 1, +1):
	total = total + 5 * i
	if total > num:
		break
	else:
		count += 1
print(count)


(n, k) = str(input()).split()
n = int(n)
k = (240 - int(k)) // 5
for i in range(1, n + 1):
	if k >= i:
		k -= i
	else:
		print(i - 1)
		break
else:
	print(n)


(n, k) = map(int, input().split())
k = 240 - k

def dsg(x):

	def dsg2(y):
		ll = 0
		for i in range(1, y + 1):
			ll += i * 5
		return ll
	return dsg2
dsg3 = dsg(5)
while dsg3(n) > k:
	n -= 1
else:
	print(n)


lst = list(map(int, input().split()))
ans = 0
total = 0
for i in range(lst[0] + 1):
	total += 5 * i
	if total <= 240 - lst[1]:
		ans = i
print(ans)


(n, t) = map(int, input().split())
t_left = 240 - t
sum_count = 0
for i in range(n):
	t_left -= 5 * (i + 1)
	if t_left >= 0:
		sum_count += 1
	else:
		break
print(sum_count)


(n, k) = tuple(map(int, input().split()))
(total, count) = (0, 0)
for i in range(1, n + 1):
	total += 5 * i
	if total + k <= 240:
		count += 1
	else:
		break
print(count)


n = input()
n = n.split()
a = int(n[0])
b = int(n[1])
s = 240
count = 0
q = []
for i in range(1, a + 1):
	if s - (i * 5 + b) >= 0:
		s = s - i * 5
		count += 1
	else:
		break
print(count)


(n, k) = map(int, input().split(' '))
Total = 240
subtract = Total - k
sum = 0
for i in range(1, n + 1):
	sum = sum + 5 * i
	if sum > subtract:
		sum = sum - 5 ** i
		if sum == subtract or sum < subtract:
			print(i - 1)
			break
	elif sum == subtract:
		print(i)
		break
	elif sum < subtract and i == n:
		print(n)
		break


(n, k) = [int(x) for x in input().split()]
left = 240 - k
tmp = (-5 + pow(25 + 4 * 5 * 2 * left, 1 / 2)) / (5 * 2)
print(int(tmp) if int(tmp) < n else n)


(n, k) = [int(x) for x in input().split()]
minutes = 240 - k
problems = 0
for i in range(n):
	minutes -= (i + 1) * 5
	if minutes >= 0:
		problems += 1
		continue
	break
print(problems)


while True:
	try:
		(n, k) = [int(i) for i in input().split()]
		ans = 0
		for i in range(1, n + 1):
			if k + i * 5 <= 240:
				k += i * 5
				ans += 1
			else:
				break
		print(ans)
	except EOFError:
		break


x = input()
y = x.split()
a = int(y[0])
b = int(y[1])
time = 240 - b
count = 0
for i in range(a):
	if time - 5 * (i + 1) >= 0:
		time = time - 5 * (i + 1)
		count = count + 1
	else:
		break
print(count)


try:
	(n, k) = map(int, input().split())
	rem = 240 - k
	count = 0
	i = 1
	while rem >= 5 * i:
		rem -= 5 * i
		i += 1
		count += 1
	if count > n:
		print(n)
	else:
		print(count)
except:
	pass


(n, k) = map(int, input().split())
k = 240 - k
i = 0
c = 0
b = 0
while b < k:
	i += 1
	c = i * 5
	b += c
if b > k:
	if i > n:
		print(n)
	else:
		print(i - 1)
elif i > n:
	print(n)
else:
	print(i)


class Solution750A:

	def __init__(self):
		self.result = ''
		self.k = 0
		self.n = 0
		self.result = 0

	def parse_input(self):
		(self.n, self.k) = [int(i) for i in input().split(' ')]

	def solve(self):
		total_time = 240
		time_per_exercise = 5
		remaining_time = total_time - self.k
		for i in range(1, self.n + 1):
			remaining_time -= time_per_exercise * i
			if remaining_time < 0:
				break
			self.result += 1

	def get_result(self):
		return str(self.result)
solution = Solution750A()
solution.parse_input()
solution.solve()
print(solution.get_result())


(n, k) = [int(x) for x in input().strip().split(' ')]
(sum_pros, cnt) = (0, 0)
while sum_pros <= 240 - k and cnt <= n:
	cnt += 1
	sum_pros += 5 * cnt
print(cnt - 1)


(n, k) = [int(i) for i in input().split()]
t = 240 - k
l = 0
r = n + 1
while l != r - 1:
	b = (l + r) // 2
	if b * (10 + 5 * (b - 1)) / 2 > t:
		r = b
	else:
		l = b
print(l)


str_ = input()
aa = str_.split(' ')
a = int(aa[0])
b = int(aa[1])
mins = 240
late = mins - b
res = 0
j = 0
while late >= j:
	res += 1
	j += 5 * res
	if res - 1 == a:
		break
print(res - 1)


def calc(problems, minutes):
	for i in range(1, problems + 1):
		minutes -= 5 * i
		if minutes < 0:
			return max(0, i - 1)
	return problems
(problems, walk) = map(int, input().split())
minutes = 4 * 60 - walk
print(calc(problems, minutes))


(n, k) = [int(i) for i in input().split(' ')]
remaining_minutes = 240 - k
count = 0
i = 1
while remaining_minutes > 0:
	remaining_minutes -= i * 5
	if remaining_minutes < 0:
		break
	else:
		i += 1
		count += 1
if count < n:
	if count == 0:
		print(0)
	else:
		print(count)
else:
	print(n)


(n, time) = map(int, input().split())
k = 240 - time
if k < 5:
	print(0)
else:
	k = k * 2 / 5
	l = 1
	r = n
	md = 0
	while l <= r:
		mid = (l + r) // 2
		cost = mid * (mid + 1)
		if cost == k:
			md = mid
			break
		elif cost < k:
			md = mid
			l = mid + 1
		elif cost > k:
			r = mid - 1
	print(md)


(n, k) = list(map(int, input().split()))
minutes_left_for_solving = 4 * 60 - k
total = 0
index = 1
while True:
	total += 5 * index
	if total > minutes_left_for_solving or index > n:
		break
	index += 1
print(index - 1)


(n, k) = map(int, input().split())
cnt = 0
ost = 240 - k
i = 1
t = 5 * i
while t <= ost:
	i += 1
	cnt += 1
	ost = ost - t
	t = 5 * i
	if cnt == n:
		break
print(cnt)


def main():
	(problems, time_to_party) = map(int, input().split())
	solved_problems = 0
	while time_to_party + (5 + solved_problems * 5) <= 240 and solved_problems != problems:
		time_to_party += 5 + solved_problems * 5
		solved_problems += 1
	print(solved_problems)
main()


import math
(n, k) = map(int, input().split())
total = 0
i = 1
while i <= n:
	total += 5 * i
	if total + k <= 240:
		i += 1
	else:
		break
print(i - 1)


ans = 0
(n, t) = (int(i) for i in input().split())
d = 0
for i in range(n + 1):
	d = 0
	for j in range(i + 1):
		d += 5 * j
		if d + t <= 240:
			ans = j
print(ans)


(n, k) = map(int, input().split())
time = 240 - k
task = 0
i = 1
while task < n and time > 0:
	time -= i * 5
	i += 1
	task += 1
if time < 0:
	task -= 1
print(task)


(a, b) = (int(v) for v in input().split())
t = 0
for i in range(a):
	t += (i + 1) * 5
	if t + b > 240:
		print(i)
		break
	elif i == a - 1 and t + b <= 240:
		print(i + 1)
		break
	else:
		pass