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?

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.

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.

NoteIn 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.

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<long long, long long> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
#define endl "\n"
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
void arrayIn(ll* A,ll n){ for ( ll K = 0; K < n; K++){ cin >> A[K]; } }
void arrayOut(ll* A,ll n){ for ( ll K = 0; K < n; K++){ cout << A[K]<<' '; } }
//declare variable----------------------------------------------------

//--------------------------------------------------------------------------
int main(){
    FASTIO;
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    // CODE--------------------------------------------------------------
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        k=k+i*5;
        if(k>240){
            cout<<--i;
            return 0;
        }
    }
    cout<<n;
//---------------------------------------------------------------------
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,k;
int main(){
    cin>>n>>k;
    for(int x=1;x<=n;x++)
        if(x*(x+1)*2.5+k>240){cout<<x-1;return 0;}
    cout<<n;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,last=240;
	cin>>n>>k;
	last-=k;
	for(int i=1;i<=n;i++)
	{
		last-=5*i;
		if(last<0)
		{
			cout<<i-1<<endl;
			return 0;
		}
	}
	cout<<n<<endl;
	return 0;
}

#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<iomanip>
#include<cmath>
#include<stack>
#include<map>
#define ll unsigned long long
int sum(int k)
{
	if (k < 0)
		return 0;
	int t = 0;
	while (k)
	{
		t += 5 * k;
		k--;
	}
	return t;
}
using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;
	int time = 240 - k;
	int i = n/2;
	if(sum(i) <= time)
	{
		while(sum(i+1) <= time && i <= n)
			i++;

	}
	else
	{
		while (sum(i)> time && i >= 0)
		{
			i--;
		}

	}
	cout << min(max(0,i),n) << endl;
	//system("pause");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int s=4*60;
int main()
{
	int k,n,i;
	cin>>n>>k;
	s-=k;
	for(i=1;i<=n;i++)
	{
		s-=i*5;
		if(s<0)
		{
			cout<<i-1;
			return 0;
		}
	}
	cout<<n;
}

#include<cstdio>
#include<iostream>
using namespace std;
int n,k;
int main(){
    cin>>n>>k;
    k=240-k;
    for(int i=1;i<=n;i++)
    {
        if(i*5>k)
        {
            cout<<i-1<<endl;
            return 0;
        }
        k-=i*5;
    }
    cout<<n<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,k;
int main(){
    scanf ("%d%d",&n,&k);
    k=240-k;
    int ans=0;
    for (int i=1;i<=n;i++)
        if (k<5*i) break;
        else k-=5*i,ans++;
    printf ("%d",ans);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int np,oprt,temp,temp2;
    cin>>np>>oprt;

    temp=240-oprt;

    temp2=((np*(np+1))/2)*5;

    for(int w=np;w>=0;w--,np--)
    {
        if(oprt==240)
        {cout<<0;break;}

        else if(temp2 <= temp)
        {cout<<np;break;}

         temp2-=np*5;
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,m;
	cin>>n>>m;
	m=240-m;
	for(i=0; (i+1)<=n && (i+1)*(i+2)*5/2<=m; i++);
	cout<<i;

}

#include<bits/stdc++.h>
using namespace std;
int n,k;
int ans;
int main(){
	scanf("%d%d",&n,&k);
	k=240-k;
	for(int i=1;i<=n;i++){
		k-=i*5;
		if(k<0) break;
		ans++;
	}
	printf("%d",ans);

	return 0;
}

#include <iostream>
using namespace std;
int main(){
	int num, got,leftt;
	cin>>num>>got;
	leftt=240-got;
	int i=1;
	if(leftt==0){
		cout<<0;
	}
	else{
		for(i=1;leftt>=0;i++){
			leftt=leftt-5*i;
		}
		if(i-2>=num){
			cout<<num;
		}
		else cout<<i-2;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,k;
int ans=0;
int main()
{
    cin>>n>>k;
    k=240-k;
    for(int i=1;i<=n;i++)
    {
        if(5*i<=k)
        {
            k=k-(5*i);
            ans++;
        }
    }
    cout<<ans;
    return 0;
}

#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>

using namespace std;

int  sum = 0,ans = 0;

main ()
{
	int n,k;
	cin >> n >> k;

	ans = 1440 - k;
	for (int i = 1; i <= n; ++i)
	{
		//cout << ans << "\n";
		if (ans - (5 * i) < 1200){
			cout << sum;
			return 0;
		}
		else if (ans - (5 * i) == 1200)
		{
			cout << sum + 1;
			return 0;
		}
		ans = ans  -  (5 * i);
		++sum;
		if (i == n ){
			cout <<sum;
			return 0;
		}
	}
}

#include<bits/stdc++.h>
using namespace std;
int n,k;
int main()
{
	cin>>n>>k,k=(240-k)/5;
	for(int x=1;x<=n;x++)
		if(x*(x+1)/2>k){cout<<x-1;return 0;}
	cout<<n;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,k;cin>>n>>k;
    int a[n];
    a[0]=5;
    for(int i=1;i<n;i++){
        a[i]=5*(i+1)+a[i-1];
    }
    k=240-k;
    if(k<=0){
        puts("0");
        return 0;
    }
    int l=-1,h=n-1;
    while(l<h){
        int mid=(l+h+1)/2;
        if(a[mid]<=k)
            l=mid;
        else
            h=mid-1;
    }
    cout<<l+1<<endl;

    return 0;
}

#include <stdio.h>
using namespace std;
int main()
{
    int n,k; scanf("%d %d",&n,&k);
    int h=240-k;
    for(int i=1; i<=n; i++)
    {
        if(i*5>h)
        {
            printf("%d",i-1);
            return 0;
        }
        h-=i*5;
    }
    printf("%d\n",n);
    return 0;
}

#include<iostream>
using namespace std;
int main(){
	long long  int n ,k ,t=0;
	cin>>n>>k;
	while(k <=240){
	t++;k += 5*t;
	}
	cout<<min(t-1,n);
}

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    int rel=4*60-k;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        while(rel>=(ans+1)*5&&(ans+1)<=n)
        {
            ans++;
            rel-=ans*5;
            if(rel<=0)   break;
        }
    }
    cout<<ans<<endl;
    return 0;
}

#include <iostream>

using namespace std;
int n,k,mid,r,l,s,i,maxi,maximid;
int main()
{
    cin>>n>>k;
    if (k>235)
    {
        cout<<mid;
        return 0;
    }
    else
    {
        r=n;
        l=1;
        while(l!=r)
        {
            s=0;
            mid=(l+r+1)/2;
            for (i=1;i<=mid;i++)
                s=s+5*i;
            if(s==240-k)
            {
                cout<<mid;
                return 0;
            }
            else if(s<240-k)
            {
                l=mid;
                /*if (240-s>maxi)
                {
                    maxi=240-s;
                    maximid=mid;
                }*/
            }
            else r=mid-1;
        }

        cout<<l;
        return 0;
    }

}

#include<stdio.h>
int main()
{
	int n,k,yushu,i;
	scanf("%d %d",&n,&k);
	yushu=240-k;
	i=1;
	while (i<=n&&yushu/(i*5)>0){
		yushu=yushu-i*5;
		i=i+1;
	}
	printf ("%d\n",i-1);
	return 0;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(void)
{
    ll i , n, j , k, l , counter = 0  ;

    cin >> n >> k;

    if( k >= 236 )
    {
        cout << 0 <<endl;
        return 0;
    }

    ll a = 240 - k ;

    ll ans = a / 5 ;
    ll sum = 0;
    counter  = 0;
    for( i = 5; i<=a ; i+=5)
    {
        sum+=i ;
        counter++;
        if(sum==a)
        {
            if(counter > n)
            {
              cout << n <<endl;
            }
            else
            {
                  cout << counter <<endl;
            }

            break;
        }
        else if(sum > a)
        {
            if(counter > n)
            {
              cout << n <<endl;
            }
            else
            {
                  cout << counter - 1 <<endl;
            }
            break;
        }
    }

}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,k,res=0;
	cin >> n >> k;
	int diff=240-k;
	vector <int> arr(n);
	arr[0]=5;
	for(int i=1;i<n;i++){
		arr[i]=5*(i+1) + arr[i-1];
	}
	res=upper_bound(arr.begin(),arr.end(),diff)-arr.begin();
	cout << res << endl;
}

#include <bits/stdc++.h>
using namespace std;

int main() {

	int n,k;
	cin>>n>>k;
	int a[n+1];
	int sum[n+1];
	a[0]=5;
	for(int i=1;i<n;i++){
	    a[i]=a[i-1]+5*(i+1);

	}
    /*for(int i=0;i<n;i++){cout<<a[i]<<" ";}
    cout<<endl;*/
	int key=240-k,l=0,h=n-1,res;
//	cout<<"key is "<<key<<endl;
    int i,f=0;
	for( i=0;i<n;i++){
	    if(key<a[i]){
	        f=1;cout<<i<<endl;
	        break;
	    }
	    if(a[i]==key){
	        f=1;cout<<i+1<<endl;
	        break;}
	}
	if(!f)
	cout<<n<<endl;

}

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,m;
	cin>>n>>m;
	int soat =240-m;
	int k=0;
	int s=0;
	for (int i=1;i<=n;i++)
	{
		s+=5*i;
		if (s<=soat)
		{
			k++;
		}
		else {
			break;
		}
	}
	cout <<k;
	return 0;
}

#include<iostream>
using namespace std;
int main(void){
int a,b,k=0;
	cin>>a>>b;
while(b<=240)k++,b+=5*k;
cout<<min(k-1,a);
return 0;
	}

#include <iostream>
using namespace std;
int mas[11];
int main()
{
	int n, k;
	cin >> n >> k;
	int d = 0; //время на задачи
	int m = 0; //счетчик задач
	int a = 240 - k; //скока время нужно

	for (int i = 1; i <= n; i++) {
		d = d + 5 * i;
		m++;
	}

	if (a < d) {
		for (int j = m; j > 0; j--) {
			d = d - 5 * j;
			m--;
			if (a >= d) {
				break;
			}
		}
		cout << m;
	}
	else {
		cout << m;
	}
	return 0;
}

#include <iostream>

using namespace std;
#include  <string>
int main()
{
    int j,h,i,n,k;
    i=0;
    j=1;
    h=5*j+i;
    cin>> n >> k;
    while (h<=4*60-k && j<= n){
        i+=5*j;
        j++;
        h=5*j+i;
    }
    cout<< j-1;
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int n  ,k;
    scanf("%d%d",&n,&k);
    int m = (60*4) - k;
    int lo=0 , hi=n;
    while (lo < hi)
    {
        int mid = lo + (hi-lo+1)/2;
        int s=0;
        for (int i=0 ; i<=mid;i++)
        {
            s += 5*i;
        }
        if (s<= m) lo=mid;
        else hi=mid-1;
    }
    cout<<lo;
    return 0;
}

#include <iostream>
using namespace std;
int n, k, sum, res;
int main( ) {
	cin >> n >> k;
	res = 240 - k;
	for(int i = 1; i <= n + 10; i++) {
		sum += 5 * i;
		if(sum > res) {
			if(i - 1 > n) {
				cout << n;
			} else
			cout << i - 1;
			return 0;
		}
	}
	return 0;
}

#include"stdio.h"

int main()
{
	int n, k;
	scanf("%d", &n);
	scanf("%d", &k);
	int timedu = 240 - k;
	int dembai = 0;
	int i = 1;
	while (timedu > 0 && dembai < n)
	{
		timedu -= i * 5;
		i++;
		dembai++;
	}
	if (timedu < 0)
		dembai--;
	printf("%d", dembai);
}

#include<iostream>

using namespace std;

int cnt[15];
int main()
{
    int n,k;cin>>n>>k;
    int v = 240 - k;
    int s=0,l=0,h=n,i=0,mid;cnt[1]=5;
    for(int i=2;i<=n;i++)
        cnt[i]=cnt[i-1]+(i*5);

    while(l<h)
    {
        mid = (l+h+1)/2;// a = 5 10 15 , v =18

         if(cnt[mid]<=v)
            l=mid;
        else
            h=mid-1;

    }
    cout<<l;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a,b;

    cin>>a>>b;
    int i;
    for(i= 1; i<=a;i++){
        b += i*5;
        if (b>240) {
            break;
        }
    }
    cout<<i-1;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,i=1,j=0;
    cin>>n>>k;
    int sum=0;
    k=240-k;
    while(sum<=k)
    {
        if(sum==k)
        {
            if(j<=n)
    cout<<j;
    else
    cout<<n;
            return 0;
        }
        else
        {
        sum=sum+5*i;
        i++;
        j++;
        }
    }

    if(j<=n)
    cout<<j-1;
    else
    cout<<n;

}

#include<iostream>
using namespace std;
int main()
{
int n,i,k,s=0;
cin>>n>>k;
k=240-k;
for(i=1;i<=n;i++)
{
  k=k-5*i;
    if(k<0)
    break;
        s++;}
    cout<<s;

}

#include <iostream>

using namespace std;

int main()
{
int x,y,ans=0,sum=0;
cin>>x>>y;
if(x>=y && x!=10)
{cout<<x;
    return 0;
}
if(x==10 && x>y)
{cout<<x-1;
    return 0;
}

ans=240-y;
for(int i=5;i<=ans&&sum<x;i+=5)
   {sum++;
    ans-=i;}
cout<<sum;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,i,sum=0;
	cin>>n>>m;
	for(i=1;i<=n;i++){
        if(i*(i+1)*2.5+m>240){
			cout<<i-1;
			return 0;
		}
	}
    cout<<n;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int t,mi,ti,i;
int main(){
cin>>ti>>t;
t=(240-t)/5;
for(i=ti;i>=0;i--){
	if((i*i+i)/2<=t) {
		cout<<i;
		return 0;
	}
}
return 0;
}

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int a,b;
int main()
{
    int ans;
    while(cin>>a>>b)
    {
        int tmp=240-b;
        if(tmp<5)
            ans=0;
        else
        {
            for(int i=1; i<=a; i++)
            {
                tmp-=i*5;
                if(tmp<(i+1)*5&&i+1<=a)
                {
                    ans=i;
                    break;
                }
                else if(tmp==(i+1)*5&&i+1<=a)
                {
                    ans=i+1;
                    break;
                }
                else if(i==a)
                    ans=i;

            }

        }
        cout<<ans<<endl;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,k;

int main ()
{
    scanf("%d%d",&n,&k);
    for(register int i=1;i<=n;i++)
        if(i*(i+1)*5/2+k>240)
		{
			printf("%d\n",i-1);
			return 0;
		}
    printf("%d\n",n);
    return 0;
}

#include <iostream>

using namespace std;
short n,k,i;
int main()
{
    cin>>n>>k;
    for(i=1;i<=n;++i)
        if(5*(i*i+i)/2+k>240)
            break;
    cout<<i-1;
    return 0;
}

#include<iostream>
using namespace std;
int main(){
    int n,k,i;
    cin>>n>>k;
    k=240-k;
    for(i=1;i<=n;i++){
        k-=i*5;
        if(k<0)break;
    }
    cout<<i-1;
    return 0;
}

#include <cstdio>
int main(){
	int k,n,problems=0,time=0;
	scanf("%d %d",&n,&k);
	for(int i=1; i<=n; i++){
		time+=5*i;
		if(240-time>=k) problems++;
	}
	printf("%d",problems);
}

#include<bits/stdc++.h>
#define lb lower_bound
using namespace std;
int main()
{
    int n,k;cin>>n>>k;
    vector<int> v(n);v.at(0)=5;
    for(int i=1;i<n;i++) v.at(i)=(i+1)*5+v.at(i-1);
    int a=lb(v.begin(),v.end(),240-k)-v.begin();
    if(a==n)cout<<a;
    else if(v.at(a)==(240-k))cout<<a+1;
    else cout<<a;
    return 0;
}

#include<iostream>
using namespace std;
int main(){
	int a,n,k,sum=0,c=0;
	cin>>n>>k;
	a=240-k;
	for(int i=1;i<=n;i++){
		sum+=i*5;
		if(a>=sum)
			c++;
	}
	cout<<c<<endl;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n,k,counter=0;
    int sum=0;
    int product=1;
    int sum2=0;

    int x;
    cin>>n>>k;
    x=(240-k);

for(int i=1;i<=n;i++)
{
    sum2=sum2+i;
}
if(k==240)
    cout<<0;
  else if(sum2*5<=x)
    cout<<n;
 else
    {

    for(int i=1;i<=n;i++)
     {
         product=i*5;
         sum=sum+product;
         counter++;
         if(sum>x)
            break;

     }
     cout<<counter-1;}

    }

#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>
#define MaxN 1005
using namespace std;

int t=240,N,T;
int main()
{
	scanf("%d%d",&N,&T);
	t-=T;
	int pos=0;
	while(pos<N&&(pos+1)*(pos+2)*5/2<=t)
		pos++;
	printf("%d",pos);
	return 0;
}

#include <iostream>

using namespace std;
int n,k,l,r,mid;

int main()
{
    cin >> n >> k;
    if(n==k && k==1)
    {
        cout << 1;
        return 0;
    }
    if(k>=236)
    {
        cout << 0;
        return 0;
    }
    if(n==1 && k<=235)
    {
        cout << 1;
        return 0;
    }
    l=1;
    r=n;
    while(l!=r)
    {
        mid=(l+r+1)/2;
        if(5*mid*(mid+1)/2>240-k)
            r=mid-1;
        else
            l=mid;
    }
    if(5*mid*(mid+1)/2>240-k)
        cout << mid-1;
    else
        cout << mid;
    return 0;
}

#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;

int main(int argc, char *argv[])
{
    int n,k,t=240,v=0;
    cin>>n>>k;
    if(t-k<5)
    cout <<0;
    else {
    t-=k;
    for(int i=1;i<=n;i++)
    {
         t-=(i*5);
         v+=(i*5);
         if(t<0)
         {cout<<i-1;return 0;}
         if(t<5)
         {cout<<i;return 0;}
    }
            cout<<n;

    return EXIT_SUCCESS;}
}

#include <iostream>

using namespace std;

int main()
{
    int n,k,left_time,problems_solved=0;
    cin>>n>>k;
    left_time=240-k;
    int i=1;int sum=0;
    while(i<=n)
    {
        //cout<<"before entering"<<i<<endl;
        sum+=i*5;
        //cout<<sum<<endl;
        if(sum<=left_time)
          {
              problems_solved=i;

          }
          i++;

    }
        cout<<problems_solved<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int a,b,i=0;
   cin>>a>>b;
   while(b<=240)
   {
      i++;
      b+=i*5;
   }
   cout<<min(i-1,a);
}

#include <iostream>
using namespace std;
int main(){
	int n, k;
	int i=1;
	cin>>n>>k;
	int t=240-k;
	t-=5*1;
	while(t-5*i>0){
		if(n==1)
			break;
		i++;
		t-=5*i;
		if(i==n){
			break;
		}
	}
	if(t<0)
		i--;
	cout<<i<<endl;
}

#include<stdio.h>
int main()
{
int n,m;
scanf("%d",&n);
scanf("%d",&m);
int res=0;
int result=240-m;
int count=0;
for(int i=1;i<=n;i++)
{
res+=i*5;
if(res<=result)
{
count=count+1;

}
}
printf("%d",count);
}

#include<bits/stdc++.h>
using namespace std;
int n,k;
int main()
{
    cin>>n>>k;
    for(int x=1;x<=n;x++)
        if(x*(x+1)*2.5+k>240){cout<<x-1;return 0;}
    cout<<n;
    return 0;
}

#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<set>
#include<string>
#include<deque>
using namespace std;

int main() {
	int time = 4 * 60;
	int n, k;
	cin >> n >> k;
	time -= k;
	int ans = n;
	for (int i = 1; i <= n; i++) {
		if (i * 5 > time) { ans = i - 1; break; }
		else time -= i * 5;
	}
	cout << ans;
}

#include <bits/stdc++.h>
using namespace std;
int n,k,kq,f[17];
int main()
{
    //freopen("b1.inp","r",stdin);
    //freopen("b1.out","w",stdout);
    cin>>n>>k;k=(240-k)/5;
    f[0]=0;
    for (int i=1;i<=10;i++) f[i]=f[i-1]+i;
    int d=0,c=10;kq=0;
    while (d<=c){
        int g=(d+c)/2;
        if (f[g]<=k){kq=g;d=g+1;}
        else c=g-1;
    }
    cout<<min(kq,n);
    return 0;
}

#include<iostream>

using namespace std;

int main(){
	int sum=0;
	int k,i,n;
	cin>>n>>k;
	if(k>=240) cout<<0;
	else {
		for(i=1;i<=n;i++){
			sum+=5*i;
			if(sum+k>240) break;
		}
		cout<<(i-1);
	}
}

#include <iostream>
using namespace std;

int n, k, t = 0;

int main() {
    cin >> k >> n;
    n = (240-n)/5;
    while ((t*t+3*t+2)/2 <= n && t < k) t++;
    cout << t;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define mii map<int,int>
#define tests int t; cin>>t; while(t--)
#define M 1000000007
#define pb push_back
#define ff first
#define ss second
#define pii pair<int,int>

int32_t main()
{ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n,k;
    cin>>n>>k;
    int sum=0,i;
    for(i=1;i<=n;i++)
    {
        sum=sum+5*i;
        if(!((sum+k)<=240))
        {
            break;
        }
    }
    cout<<i-1;
}

#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<iomanip>
#include<cmath>
#include<stack>
#include<map>
#define ll unsigned long long
int sum(int k)
{
	if (k < 0)
		return 0;
	int t = 0;
	while (k)
	{
		t += 5 * k;
		k--;
	}
	return t;
}
using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;
	int time = 240 - k;
	int i = 0;
	while (sum(i + 1) <= time)
		i++;
	cout << min(max(0,i),n) << endl;
	//system("pause");
	return 0;
}

#include <iostream>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int n,k,t=0;
	cin>>n>>k;
	int min=240;
	min-=k;
	if (min<=0)
	{
		cout<<0<<endl;
		return 0;
	}
	for (int i=1;i<=n;i++)
	{
		if (min-i*5<0) break;
		min-=i*5;
		t=i;
	}
    cout<<t<<endl;
	return 0;
}

#include <iostream>
#include <stdio.h>

using namespace std;
   int a,b,i,k,n;
   bool m;
int main()
{
    cin >> n >>k;
    k = 240 - k;
    m = true;
for ( i = 1; i <= n; ) {
   a = i * 5;

if (a > k and m)
   {
      cout <<i-1<< endl;
      m = false;
   }
   else
    {
     k = k - a;
    }
   i++;
}
  if (m){
   cout<<n<< endl;
}
    return 0;
}

//Wilson-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
unsigned int N,M,sum;
int main(void){
	scanf("%d%d",&N,&M);
	for (int i=1;i<=N;++i){
		sum+=i*5;
		if (sum+M>240){
			cout<<i-1;
			return 0;
		}
	}
	cout<<N;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
#define loop(i,s,e) for(ll i=s;i<e;i++)
#define test ll x;cin>>x;while(x--)
#define pb push_back
#define vec vector<ll>
#define sortvec(x) sort(x.begin(),x.end())
#define sz(x) x.size()

int main () {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll n,k;
	cin>>n>>k;
	ll t=240-k;
	ll s,flag=0;
	for (ll i=n;i>0;i--)
	{
		s=5*i*(i+1)/2;
		if (s<=t && s<240)
		{
			cout<<i<<"\n";
			flag=1;
			break;
		}
	}
	if(flag==0)
		cout<<"0\n";
}

#include<bits/stdc++.h>
using namespace std;
int n,f,i;
int main()
{
	cin>>n>>f;
	f=(240-f)/5;
	for(i=1;i<=n;i++)
  	{
  		f=f-i;
	   if(f<0)
	   {
	   	break;
	   }
  	}
	cout<<i-1;
	return 0;
	}

#include<bits/stdc++.h>
#define lb lower_bound
using namespace std;
int main()
{
  int n,k;cin>>n>>k;
  vector<int> v(n);v.at(0)=5;
  for(int i=1;i<n;i++)v.at(i)=(5*(i+1))+v.at(i-1);
  int a=lb(v.begin(),v.end(),240-k)-v.begin();
  if(a==n) cout<<a;
  else if(v.at(a)==240-k)cout<<a+1;
  else cout<<a;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,k,s;
int main()
{
cin>>n>>k;
s+=k;
for(int i=1;i<=n;i++)
{
s+=i*5;
if(s>240)
{
cout<<i-1;
return 0;
}
}
cout<<n;
}

#include <cstdio>
int n,k,cur,cnt;
int main()
{
    scanf("%d%d",&n,&k);
    cur=240-k;
    for(int i=1;i<=n;i++)
    {
        int now=5*i;
        if(cur>=now) cur-=now,++cnt;
        else break;
    }
    printf("%d\n",cnt);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
int n, k ;
int main()
{
    cin >>n>>k;
    int time_left=240-k,nbr=0;
     for (int i =1 ; i<=n;i++)
     {
         time_left-=i*5;
         nbr++;
         if (time_left<0){
            nbr--;
            break;
         }
     }cout<<nbr;
     return 0 ;
}

#include<cstdio>
using namespace std;
int main()
{
	int n,k;
	scanf("%d%d",&n,&k);
	k=240-k;
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		if(5*i<=k)
		{
			k=k-5*i;
			ans++;
		}
	}
	printf("%d",ans);
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n,k;
    int time=240;
    cin>>n>>k;
    time-=k;
    int i=0;
    for(i=0;i<n;i++)
    {
        if(time-5*(i+1)>=0)
            time-=5*(i+1);
        else
            break;
    }
    cout<<i<<endl;
    return 0;
}

#include<iostream>
using namespace std ;
int main ()
{
	int x , y , z , m ;
	cin>>x>>y;
	z=240-y;

	if(z<5)
		{
										m=0;
										if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
	else if (z<15 && z>=5)
		{
										m=1;
			                        	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
		else if (z<30 && z>=15)
		{
										m=2;
			                        	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
		else if (z<50 && z>=30)
		{
										m=3;
			                        	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
			else if (z<75 && z>=50)
		{
										m=4;
			                        	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
			else if (z<105 && z>=75)
		{
										m=5;
			                      if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
				else if (z<140 && z>=105)
		{
										m=6;
			                        	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
				else if (z<180 && z>=140)
		{
										m=7;
			                        	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}
					else if (z<225 && z>=180)
						{
							m=8;
				if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				}
					else if (z<275 && z>=225)
								{
									m=9;
		                             	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

					}

						else if (z<300 && z>=275)
		                  			{
										m=10;
			                        	if(m>x)
			                        	cout<<x<<endl;
										else
											cout<<m<<endl;

				                 	}

return 0 ;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <numeric>
#include <set>
#include <cmath>
#include <random>
#include <ctime>
#include <chrono>
#define INF ((unsigned) ~0)
#define DEBUG(x) cout << #x << " = " << x << '\n'
#define endl '\n'
using namespace std;
using namespace std::chrono;
int binarySearch(vector<int>, int);

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	const int ct = 240;
	int n, k; cin >> n >> k;
	int tm = ct - k,
		q = 0,
		i = 1;
	while (tm > 0) {
		if (tm < (5*i) || i>n) break;
		tm -= (5 * i);
		q++;
		i++;
	}
	cout << q << endl;
}

int binarySearch(vector<int> a, int target) {
	int N = a.size(), L = 0, R = N - 1, mid = 0;
	while (L <= R) {
	mid = L + (R - L) / 2;
		if (a[mid] == target)
		{
			return mid;
		}
		if (a[mid] < target) {
			L = mid + 1;
		}
		else {
			R = mid - 1;
		}
	}
	return -1;
}

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define ull unsigned long long
#define d digital

int main()
{
	int n, k;
	cin >> n >> k;
	int left = 240 - k;
	int i = 0, t = 0;
	while (i + 1 <= n && t + (i + 1) * 5 <= left) {
		i++;
		t += i * 5;
	}
	cout << i << endl;
}

#include <iostream>

using namespace std;

int time = 240, n, k, ZadTime = 0;

int main()
{

    cin >> n; cin >> k;
    time -= k;
    for (int i = 1; i <= n; i++)
        ZadTime += i * 5;

    int i = n;
    while (true)
    {
       if (ZadTime <= time) break;

       ZadTime -= 5 * i;
       i--;
    }

   /* i = 1;
    while (i < n)
    {
        if (ZadTime = 0) break;
        ZadTime -= i * 5;
        i++;
    }*/

    cout << i << endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,k;
    cin>>n>>k;
    int c=0;
    k=240-k;
    for(int i=1;i<=n;i++)
    {
        k-=(5*i);
        if(k<0) break;
        c++;
    }
    cout<<c<<"\n";
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
   ll n,k,sum=0,c=0;
   cin>>n>>k;
   ll rem=240-k;
   for(int i=1;i<=n;i++)
   {
       sum+=5*i;
       if(sum>rem) break;
       c++;
   }
   cout<<c<<endl;
}

#include <iostream>
using namespace std;

int calculate(int n){
  int sum = 0;
  for(int i = 1; i <= n; i++){
	sum += i * 5;
  }
  return sum;
}

int main(void){

  int n, k, sum, a;
  cin >> n >> k;
  for(int i = n; i >= 0; i--){
  	sum = 0;
  	sum = calculate(i) + k;
  	if(sum <= 240){
  		a = i; break;
	  }
  }
  cout << a;
}

#include<iostream>
using namespace std;
int main()
{
    int i=1,n,k,time;

    cin>>n;

    cin>>k;
    time=240-k;
    while(time>=0)
    {
        time=time-(5*i);
        i++;
    }
    if(i-2>=n){cout<<n;return 0;}
    cout<<i-2;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,k;
	cin>>n>>k;
	vector<int>q(n);
	q[0]=5;
	for(int i=1;i<n;++i){
		q[i]=q[i-1]+(i+1)*5;
	}
	int w=240-k;
	int res=0;
	for(int i=0;i<n;++i){
		if(q[i]>w){
			res=i;
			break;
		}
		if(q[i]==w){
			res=i+1;
			break;
		}
	}
	if(q[n-1]<w){
		cout<<n;
	}else{
		cout<<res;
	}
	return 0;
}

#include <iostream>
using namespace std;
int n,k;
int main(){
	cin>>n>>k;
	int t=240,i=5,j=0;
	t-=k;
	while(t>0){
		t-=i;
		i+=5;
		j++;
		if(t<0){
			j--;
			break;
		}
		if(j==n)
			break;
	}
	cout<<j<<endl;
//	system("pause");
	return 0;
}

//#include "pch.h"
#include <iostream>
using namespace std;

int main()
{
	int n, t, T, i = 0;
	cin >> n >> t;
	T = 240 - t;
	while (T >= 5 * (i + 1)) {
		T -= 5 * i;
		if (T >= 5 * (i + 1))
			i++;
	}
	if (i >= n)
		cout << n;
	else
		cout << i;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,i=1;
	scanf("%d%d",&n,&m);
	while(m+i*5<=240&&i<=n){
		m+=i*5;
		i++;
	}
	printf("%d",i-1);
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,i,hour,number;
    hour=240;
    number=0;
    cin>>n>>k;
    hour-=k;
    for(int i=1;i<=n;i++)
    {
        if(i*5<=hour)
        {
            hour-=i*5;
            number++;
        }
        else
            break;
    }
    cout<<number<<endl;
    return 0;
}

#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;

int main() {
	long long int n,k,m,c;
	cin>>n;
	cin>>m;
	c=240-m;
	k=c%5;
	c=c-k;

	vector<long long int>a;
	for(long long int i=0;i<=n;i++)
	{
	    a.push_back(i*5);

	}
	for(long long int i=1;i<=n;i++)
	{
	    a[i]=a[i]+a[i-1];
	}
	vector<long long int>::iterator upper;
	upper=upper_bound(a.begin(),a.end(),c);
cout<<upper-a.begin()-1;

	return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int number, minute, sum = 0,total=0;
	cin >> number >> minute;
	for (int c = 1; c <= number; c++){
		sum += 5;
		total += sum;
		if (total + minute > 240){
			cout << c - 1;
			break;
		}
		else if (c == number)cout << c;
	}
}

#include <iostream>
using namespace std;
int n,k,a=0;
int main (){
    cin>>n>>k;
    int s=240-k;
    for(int i=0;i<=n;i++){
            int t=5*i*(i+1)/2;
    if(t<=s){
        a=i;
    }}
    cout<<a;
    return 0;}

#include<iostream>

using namespace std;

int main(){
	int sum=0;
	int k,i,n;
	cin>>n>>k;
	if(k>=240) cout<<0;
	else {
		for(i=1;i<=n;i++){
			sum+=5*i;
			if(sum+k>240) break;
		}
		cout<<(i-1);
	}
}

#include <iostream>

using namespace std;

int main()
{
int x,y,ans=0,sum=0;
cin>>x>>y;
if(x>=y && x!=10)
{cout<<x;
    return 0;
}
if(x==10 && x>y)
{cout<<x-1;
    return 0;
}

ans=240-y;
for(int i=5;i<=ans&&sum<x;i+=5)
   {sum++;
    ans-=i;}
cout<<sum;

    return 0;
}

 #include<bits/stdc++.h>
    #include<algorithm>
    using namespace std;
    int main()
    {
        int n,k,i,minn=0;
        scanf("%d%d",&n,&k);
        for(i=1;i<=n;i++){
            minn+=i*5;
            if(minn>240-k){
                printf("%d\n",i-1);
                return 0;
            }
        }
        printf("%d\n",i-1);
        return 0;
    }

#include <iostream>
using namespace std;
int main()
{
	int n, k;
	cin >> n >> k;
	for(int i = 1; i <= n; i++)
	{
		if(i * (i + 1) * 2.5 + k > 240)
		{
			cout << i - 1;
			return 0;
		}
	}
	cout << n << endl;
	return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int n,k,sum=0,ans;
    cin>>n>>k;
    int t=240-k;
    for(int i=1;i<=n;i++)
    {
        sum=sum+5*i;
        if(sum<=t)
        {

        }
        else
        {
           ans=i-1;
        break;
        }
        ans=i;
    }
    cout<<ans<<endl;
    return 0;
}//ffsdskoddks//

// Problem http://codeforces.com/problemset/problem/750/A
// Solution for, https://harun9009.wordpress.com/2017/08/28/codeforces-solution-750a-new-year-and-hurry/
// Language GNU G++ 5.1.0
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
 int n,k,i,minn=0;
 scanf("%d%d",&n,&k);
 for(i=1;i<=n;i++){
 minn+=i*5;
 if(minn>240-k){
 printf("%d\n",i-1);
 return 0;
 }
 }
 printf("%d\n",i-1);
 return 0;
}

#include<iostream>
#include<string.h>
#include<iomanip>
#include<math.h>

using namespace std;
int main()

				{ int n,k,a,b;
				  cin>>n>>k;
				  k=240-k;

				  for(int i=1;;i++)
				  {a=(i*(10+((i-1)*5)))/2;

				   if(k<5){b=0;break;
				  }
				  else{
				  if(a>k){b=i-1;break; }
				  else{if(a==k){b=i;break;
				  }}
				   }}

				  if(b<=n){cout<<b;}
				  else{cout<<n;  }}

// Example program
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, t;
    cin >> n >> t;
    int k = 240 - t;
    int sum = 5, i = 1;
    if(k < 5)
    {
        cout << 0;
        return 0;
    }
    while(i < n && sum + (i + 1) * 5 <= k)
    {
        i++;
        sum += i * 5;
    }
    cout << i;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int s=4*60;
int main()
{
	int k,n,i;
	cin>>n>>k;
	s-=k;
	for(i=1;i<=n;i++)
	{
		s-=i*5;
		if(s<0)
		{
			cout<<i-1;
			return 0;
		}
	}
	cout<<n;
}

#include<bits/stdc++.h>

using namespace std;
int main()
{
	int n,k,c=0,x=0,p;
	cin>>n>>k;
	p=240-k;
	while(x<=p)
	{
		c++;
		x+=5*c;
	}
	cout<<min(n,--c);
	return 0;
}

#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    int n,k,tot=0,sheng;
    cin>>n>>k;
    sheng=240-k;
    for (int i=1;i<11;i++)
    {
        if ((5+5*i)*i/2<=sheng&&(5+5*(i+1))*(i+1)/2>sheng)
        {
            printf("%d\n",i);
            break;
        }
         if (i==n&&(5+5*i)*i/2<=sheng){
            printf("%d\n",i);
            break;
        }
        if (i==1&&sheng<5){
        	printf("0\n");
        	break;
		}
    }
    return 0;
}

//
//  main.cpp
//  codeforces
//
//  Created by Anthony Molyviatis on 4/12/17.
//  Copyright © 2017 Xelor. All rights reserved.
//

#include <iostream>

using namespace std;

int main() {

    int n, k;
    int count = 5;
    cin >> n >> k;

    int remainder = 240;
    while ( n != 0 && (remainder - k) - count >= 0){
        remainder -= count;
        count += 5;
        n--;
        cout << remainder << endl;
    }
    cout << (count/5) - 1 ;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int n,k;
	cin >> n >> k;
	int v[10];
	v[0] = 5;
	for(int i = 1 ; i < n ; i++)
	{
		int t = v[i-1]+(i+1)*5;
		v[i] = t;
	}
	int tot=240,rem=tot-k,l=0,h=n-1,mid,ans=0;
//	cout << nk << " " << rem << '\n' ;
	if(n == 1 && k < 240){
		cout << 1 << endl;
		return 0;
	}
	if(n == 1 && k > 240){
		cout << 0 << endl;
		return 0;
	}
	while(l <= h)
	{
		mid = (l+h)/2;
		if(v[mid] <= rem)
		{
			ans = mid+1;
			l = mid+1;
		}
		else
		h = mid-1;
	}
	cout << ans << endl;
	return 0;
}

#include <iostream>
using namespace std;

int main()
{
    int n, m;
    cin>>n>>m;
    int left = 240 - m;
    int answer = 0;
    for(int i = 1; i < n; i++){
        if(left>=0){
            left  = left - i*5;
        }
        if(left == 0){
            answer = i;
            break;
        }
        if(left<0){
            answer = i-1;
            break;
        }
        if(i=n-1){
            answer = m;
            break;
        }
    }
    cout<<answer;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    int time = 240;

    cin >> n >> k;

    time -= k;

    for (int i = 1; i <= n; ++i) {
        time -= i*5;

        if (time <= 0)
        {
            cout << i - 1;
            return 0;
        }
    }

    cout << n;

    return 0;
}

#include <iostream>

using namespace std;

int n, k, sum;

int main()
{
	cin >> n >> k;

	for(int i=1; i <= n; i++) {
		sum += 5;
		if(sum + (i+1)*5 + k > 240) {
			cout << i;
			return 0;
		}
	}
	cout << n;
}

#include <iostream>
using namespace std;
int main ()
{
    int n,k,ile_spr(0);
    cin >> n >> k;
    for(int i=0; i<n; i++){
        int d;
        d+=5;
        ile_spr+=d;
    }
if(ile_spr+k<=240) cout << n;
  else {
        while(ile_spr+k>240){
            ile_spr-=5;
            n--;
    cout << n;
            return 0;
        }
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble
#define szz(x) (int)(x).size()
#define repi(i, p, n) for(int i=p;i<n;i++)
#define repl(i, p, n) for(ll i=p;i<n;i++)
#define Se second
#define Fi first
#define C(x) cout<<x;
#define Ex(x) return x;

typedef tuple <int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

//ll Min=1000000000000000000;
//ll Max=-Min;

int main()
{
    ll n,k,l=0;
    cin>>n>>k;
    k=240-k;
    while(k-l*5>-1)
    {
        l++;
        k-=l*5;
    }
    C(l);
    Ex(0);
}

#include<iostream>
using namespace std;
int main()
{
    int n,k,i=0;
    cin>>n;
    cin>>k;
    if(n<=10&&n>=1)
    {

    int rt,tt=0;
    rt=240-k;
    if(rt<5)
    {
        cout<<"0";return 0;
    }
    for(i=0;i<n&&tt<=rt;)
    {i++;tt=tt+5*i;}
    cout<<i-1;
    }
    return 0;

}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k,i,s=240;
    cin>>n>>k;
    s=-k;
    for( i=0;i<n;i++){
        s=-5*i;
        if(s<0){
            break;
        }
    }
    cout<<i<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n, k, dk, gecen;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
 // freopen("out.txt","r",stdin);
 // freopen("in.txt","w",stdout);
  cin >> n >> k;
  dk = 240-k;
  for(ll i=1; i<=n ;i++){
    gecen += i*5;
    if(gecen > dk){
      cout << i-1 << endl;
      return 0;
    }
  }
}

#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define du 240

using namespace std;

int n, t, k;

int main(){_
	cin >> n >> t;
	t=du-t;

	for(int i=5; i<t; i+=5, k++);

	cout << min(n, k-1) << endl;
	return 0;
}
// 1486828196138

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,rem,i,ans=0;
    cin>>n>>k;

    rem=240-k;
    for( i=1; i<=n && rem> 5 ; i++)
    {
       if((rem-(5*i))>=0){rem=rem-(i*5);
       ans++;}

    }
    cout<<ans<<endl;
    return 0;
}

//Bao
#include <bits/stdc++.h>

using namespace std;

long long n,w,k;

int main(){
    cin >> n >> k;
    w = (240 - k) * 2 /5;
    w = sqrt(w); cout << min(n,w);
}

#include<iostream>
using namespace std;
int main()
{   int n,k,a=0,b=0,c=0,d=0;
    cin>>n>>k;
    a=4*60;
    b=a-k;
    for(int i=1;i<=b;i++){
        c+=i*5;
        if(b<c){cout<<d;break;}
        d++;}
}

#include <iostream>

using namespace std;
#include  <string>
int main()
{
    int j,i,n,k;
    i=0;
    j=1;
    cin>> n >> k;
    while (i<=4*60-k && j<= n){
        i=5*j+i;
        j++;
    }
    cout<< j-1;
    return 0;
}

#include <iostream>
#include <time.h>
#include <vector>
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;

#define IN_OUT {freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout);}
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

clock_t startTime;
void getCurrentTime() {printf("%lf", (double)(clock()-startTime)/CLOCKS_PER_SEC);}

int binary(int ara[], int n, int item) {
	int left=1, right=n, mid=left+(right-left)/2;

	if(item < ara[1]) return -1;
	else if(item > ara[n]) return n;

	while(left < right) {
		if(item==ara[left]) return left;
		if(item==ara[right]) return right;
		if(ara[mid]==item) return mid;

		if(right-left==2) {
			//in next operation: mid=left+1, right=mid+1
			if(ara[left+1]<=item) return left+1;
			else if(ara[left+1]>item) return left;
			else return left+1;
		}

		if(item > ara[mid]) left = mid+1;
		else right = mid - 1;
		mid = left+(right-left)/2;

		if(left==mid && ara[mid]!=item) return left;
		if(right==mid && ara[mid]!=item) return right-1;
	}

	return 0; //just syntax. value has been returned in loop
}

int main() {
	// startTime = clock();
	// IN_OUT
	FAST

	int n, k, i;
	cin >> n >> k;
	int ara[n+1];

	ara[0] = 0;
	for(i=1; i<=n; i++) {
		ara[i] = i*5 + ara[i-1];
	}

	cout << binary(ara, n, 240-k) << "\n";

	// getCurrentTime();
}

#include <iostream>
using namespace std;
int main()
{
	int number, minute, c;
	cin >> number >> minute;
	minute = 240 - minute;
	for (c = 1; c <= number; c++){
		minute -= (c * 5);
		if (minute < (c + 1) * 5)
			number = 0;
	}
	if (c>number)cout << c - 1;
	else cout << c;
}

#include <iostream>
using namespace std;

int search_array(int arr[10], int n, int x){
    for(int i = 0; i < n; i++){
        if(arr[i] == x){
            return i+1;
        }
        else{
            if(x < arr[i+1] && x > arr[i]){
                return i+1;
            }
        }
    }
}

int main()
{
int n, minutes;
int mArr[10];

cin>>n>>minutes;

int maxSolvingTime = 240 - minutes;
int sub_total = 0;
for(int i = 0; i < n; i++){
    mArr[i] = (5*(i+1)) + sub_total;
    sub_total = mArr[i];
}
cout<<search_array(mArr, n, maxSolvingTime);

return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n,k,kq,f[17];
int main()
{
    //freopen("b1.inp","r",stdin);
    //freopen("b1.out","w",stdout);
    cin>>n>>k;k=(240-k)/5;
    f[0]=0;
    for (int i=1;i<=10;i++) f[i]=f[i-1]+i;
    kq=lower_bound(f,f+10,k)-f;
    cout<<min(kq,n);
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    unsigned int prob, party,left,left_now,i;
    cin>>prob;
    cin>>party;
    left = 240-party;
    if (left>0){
        for(i=1;i<prob;i++)
    {
        left_now = left - 5*i;
        if(left_now<5*(i))
        break;
    }

        cout<<i;
    }

    return 0;
}

#include<iostream>
#include<string>
#include<map>
#include<set>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<deque>
using namespace std;
typedef long long int ll;
int main() {
	int n, k, c = 0, m;
	cin >> n >> k;
	m = 240 - k;
	if (m < 5)
		cout << 0 << endl;
	else
		for (int i = 1; i <= n; i++)
			if ((i*(1 + i) / 2) * 5 <= m)
				c++;
	cout << c << endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,k,n,m,t=0;
    cin>>m>>n;
    k=240-n;
   // cout<<(240-n)/5;
    while(k>0)
    {
         t++;
        k=k-5*t;
    }
    t--;
    if(t>m)
    {
        cout<<m;
    }
    else
        {
            cout<<t;
        }
}

#include <bits/stdc++.h>

using namespace std;
int n,k,s;
int main()
{
    cin>>n>>k;
    int d=1,c=n,kq,g;
    while (d<=c)
    {
        g=(d+c)/2;
        int sn=g/2*(10+(g-1)*5);
        //cout<<g<<" "<<sn<<endl;
        if (sn<=240-k) kq=g,d=g+1;
        else c=g-1;
    }
    cout<<kq;
}

#include <iostream>
using namespace std;
int main ()
{
    int n,k,ile_spr(0);
    cin >> n >> k;
    for(int i=0; i<n; i++){
        int d;
        d+=5;
        ile_spr+=d;
    }
if(ile_spr+k<=240) cout << n;
  else {
        while(ile_spr+k>240){
            ile_spr-=5;
            n--;
    cout << n;
            return 0;
        }
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d %d",&n,&k);
    int sum=k,cnt=0,m;
    for(i=1;i<=n;i++){
       m=i*5;
        sum=sum+m;
        cnt++;
        while(sum<=240){
            break;
        }

    }
    printf("%d\n",cnt);

}

#include<bits/stdc++.h>
using namespace std;
int main()

{
	long long n,k;
	cin>>n>>k;
	vector<int>g(n);
	long long prev=0,i;
	for(i=1;i<=n;i++)
	{
		g[i-1]=5*i+prev;
		prev=g[i-1];
	}
	long long d=240-k;
	if(d>=g[n-1])
	{
		cout<<n<<"\n";
	}
	else
	{
		cout<< (upper_bound(g.begin(),g.end(),d)-g.begin())-1<<"\n";
	}
	return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define sec second

using namespace std;
using ll = long long;

const int T = 240;
int a[11];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, k; cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        int temp = 5 * (i + 1);
        if (i == 0) a[i] = temp;
        else a[i] = temp + a[i - 1];
    }
    int l = 0, r = n - 1, mid = (l + r) / 2;
    while (l != r) {
        a[mid] > (T - k) ? r = mid - 1 : l = mid;
        mid = (l + r + 1) / 2;
    }
    cout << mid + (T - k > 5) << endl;

    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int a,b,i,m,c=0,sum=0;

    cin>>a>>b;

    m=240-b;
    for(i=1;i<=a;i++)
    {

       //cout<<"tt";
        c=i*5;
        sum+=c;
       // cout<<"yy"<<sum;
        if(sum>m)
        {
            cout<<i-1;break;
        }else if(sum==m)
        {
            cout<<i;break;
        }

    }
    return 0;
}

#include <cstdio>
int n,k,cur,cnt;
int main()
{
	scanf("%d%d",&n,&k);
	cur=240-k;
	for(int i=1;i<=n;i++)
	{
		int now=5*i;
		if(cur>now) cur-=now,++cnt;
		else break;
	}
	printf("%d\n",cnt);
	return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int i=0, j, k=0, n, m, sum=0, rest;
    cin >> n >> m;
    rest=240-m;
    while(k<=rest)
    {
         if(i==n || (sum > rest)) {

                break;
        }
        i++;
        sum+=(5*i);
        k=sum+(5*(i+1));
    }
    cout << i;

}

#include<bits/stdc++.h>

using namespace std;
int main()
{
    int j,c=0,i=0,y,k=0,m;

    cin>>y;
    cin>>m;

       for(i=0;i<m;i++){
      for(j=1;j<=y;j++){
        c=5*j;
        k=k+c;
       }
       if(240>=(m+k)){
        cout<<y;
        break;
       }
       else {
            k=0;
       c=0;
        y=y-1;
       }

   }

}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#define MAX(x, y) (((x) < (y)) ? (y) : (x))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
typedef long long ll;
typedef unsigned char byte;

#define MAXN 1
#define MAXM 1

int main()
{

	return 0;
}

#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;

int main() {
	long long int n,k,m,c;
	cin>>n;
	cin>>m;
	c=240-m;
	k=c%5;
	c=c-k;

	vector<long long int>a;
	for(long long int i=0;i<=n;i++)
	{
	    a.push_back(i*5);

	}
	for(long long int i=1;i<=n;i++)
	{
	    a[i]=a[i]+a[i-1];
	}

	if(c>a[n])
	{
	    cout<<n;
	}
	else{
     for(long long int i=0;i<=n;i++)
     {
         if(c==k)
         {cout<<i;
             break;
         }
     }
	}

	return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i=0,time1=0;
    scanf("%d%d",&n,&k);
    int time=240-k;
    while(1)
    {
      i++;
      if(i==n)
      break;
      time1=time1+i*5;
      if(time1>time)
      break;

    }
    printf("%d",i-1);
}

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
 int n = 0;
 int k,i,minn=0;
 scanf("%d%d",&n,&k);
 //printf("%d\n",n);
 int mi=0,ma=n;
 if(240-k<5){
 	printf("%d\n",i);
 	return 0;
 }
 while(mi<ma){
 	i = (ma+mi)/2;
 	int aux = 5*(i+1)* (double) (i/2.0);
 	int aux2 = 5*(i+2)* (double) ((i+1.0)/2);
 	int aux3 = 5*(i)* (double) ((i-1)/2);
 	//printf("%d %d %d\n",i,aux,aux2);
 	if((aux<=240-k && aux2>=240-k)){
 		if(aux==aux2){
 			printf("%d\n",i);
 			return 0;
 		}
 		if(aux2==240-k){
 			printf("%d\n",i+1);
			return 0;
 		}
 		printf("%d\n",i);
		 return 0;
 	}
 	else if(aux<=240-k){
 		mi = i+1;
 	}else{
 		ma = i-1;
 	}
 }
 printf("%d\n",i+1);
}

#include "bits/stdc++.h"
#define F first
#define S second
//#define B break
#define E exit(0)
#define endl '\n'
#define ccon continue
#define ins insert
#define rev reverse
#define pb push_back
#define pf push_front
#define ppf pop_front
#define ppb pop_back
#define sza(s) (int)(sz(s) - 1)
#define sz(s) (int)(s.size())
#define lb lower_bound()
#define ub upper_bound()
#define mkp make_pair
#define all(v) v.begin(), v.end()
#define whole(a,x) a + 1, a + x + 1
#define rall(v) v.rbegin(), v.rend()
#define out(v) copy(all(v),ostream_iterator<int>(cout," "));
#define cube(x) ((x)*(x)*(x))
#define SM(n) ((n) * (n + 1) / 2)
#define gcd __gcd
#define lcm(a,b) ((a) / gcd(a,b) * (b))
#define so(v, x) accumulate(all(v), x)
#define so2(v, x) accumulate(all(v), x, std::multiplies<int>())
#define so3(v, x) accumulate(them(v), x)
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using ll = long long;
using ld = long double;
// COPIED BY |3-|\|-|3
#define IOS ios_base::sync_with_stdio(NULL);cin.tie (nullptr);cout.tie (nullptr);
using namespace std;
using si = set<int>;
using msi = multiset<int>;
using usi = unordered_set<int>;
using vi = vector<int>;
using vs = vector<string>;
using vpis = vector<pair<int,string>>;
using vpii = vector<pair<int,int>>;
using pii = pair<int,int>;
using pis = pair<int,string>;
using mii = map<int,int>;
using umii = unordered_map<int,int>;
using mib = map<int,bool>;
using mic = map<int,char>;
using mpsi = map<string,int>;
using mis = map<int,string>;
#define QR quartet
#define u_map unordered_map
const int MyIQ = 1e18 * 0 - 7;
const int E3 = 1e3 + 7;
const int E4 = 1e4 + 7;
const int E5 = 1e5 + 7;
const int E6 = 1e6 + 7;
const int E8 = 1e8 + 7;
const int MOD = 1e9 + 7;
const long long INF = 1e18 + 7;
const int nbI[] = {(-1), (+1), (0), (0), (+1), (+1), (-1), (-1)};
const int nbJ[] = {(0), (0), (+1), (-1), (+1), (-1), (+1), (-1)};
inline void setpr(int a,double b){cout<<fixed<<setprecision(a)<<b;}
inline int fact(int n){int sum=1;for(int i=2;i<=n;i++){sum*=i;}return sum;}
inline bool prime(int n){for(int i=2;i<=sqrt(n);i++){if(n%i==0){return 0;}}return(n==1?0:1);}
inline int pow(int a,int b){int res=1;while(b){if(b&1)res*=a;a*=a;b>>=1;}return res;}
string ALS="abcdefghijklmnopqrstuvwxyz";
string ALNS="qwertyuiopasdfghjklzxcvbnm";
string YN(bool i){return (i?"YES\n":"NO\n");}
#define int long long
int t;
void KOD () {
	t=1;
	while (t--) {
	int n, k; cin>>n>>k;
	int time = 240 - k;
	int i=1;
	for(i=1;i<=n;i++)
	{
		if((time - (5*i))>0)
			time -= 5*i;
		else
			break;
	}
	cout << i;
	}
	return;
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
KOD();
return 0;
}

#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int n,k,i=0,i1=1,a;
    cin>>n>>k;
    a=240-k;
    while(a>0){
        a=a-5*i1;
        i1++;
        i++;
    }
    if(a<0){
        if(i-1 >=n){
            cout<<n;
            return 0;
        }
        cout << i-1<<"";
    }
    else
        cout<<i;
    return 0;
}

#include <iostream>
using namespace std;
int main ()
{
    int n,k,ile_spr(0);
    cin >> n >> k;
    for(int i=0; i<n; i++){
        int d;
        d+=5;
        ile_spr+=d;
    }
if(ile_spr+k<=240) cout << n;
  else {
        while(ile_spr+k>=240){
            ile_spr-=5;
            n--;
    cout << n;
            return 0;
        }
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int n, k;

int f(int m) {
    int time = 240 - k, stime = 0;
    for (int i = 1; i <= m; i++) {
        stime += (5*i);
    }
    if(m == n && time - stime > 5) {
        return 1;
    }
    if ((time - stime) < 10) {
        return 1;
    } else return 0;
}

int main() {
    cin >> n >> k;
    for (int i = 1; i <= n; i++) {
        if (f(i)) {
            cout << i << endl;
            break;
        }
    }

    return 0;
}

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        int n,k;
        int trem = 240 - k;
        int a[n+1];
        int i;
        a[0]  = 0;
        for(i=1;i<=n;i++){
            a[i] = a[i-1]+5*i;
            }
            i=1;
        while(a[i]<=trem){
            i++;
        }
        cout<<i<<endl;
        return 0;
    }

#include <bits/stdc++.h>
using namespace std;
int n,k,x;
int main()
{
    //freopen("b1.inp","r",stdin);
    //freopen("b1.out","w",stdout);
    cin>>n>>k;
    x=((240-k)/5)*2;x=sqrt(x);
    cout<<min(x,n);
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int n, k;
	cin>>n>>k;
	int *mas = new int[n];
	mas[0]=5;
	for (int i=1;i<n;i++)
	{
		mas[i]=mas[0]+(5*i)+mas[i-1];
	}
	int i;
	for (i=n;;)
	{
		if (mas[i-1]+k>240) i--;
		else break;

	}
	cout<<i<<endl;
	delete[] mas;
//	system("pause");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define in_file(filename) 	freopen(filename, "r", stdin)
#define out_file(filename) freopen(filename, "w", stdout)
#define fast_io 				ios_base::sync_with_stdio(false); cin.tie(NULL)
#define For(i, a, b) 		for(int i = (a); i < (b); i++)
#define Fore(i, a, b)		for(int i = (a); i <= (b); i++)
#define ec 						"\n"
#define all(stl)				(stl).begin(), (stl).end()
#define fi 						first
#define se 						second

typedef long long ll;
const ll INF = 1LL<<60;
const double PI = 3.14159265358979;
const int MOD = 1000000007;

int res, cnt = 1, a[11];
int main()
{
	fast_io;
	// in_file("../input.txt");
	// out_file("../output.txt");
	int n, k, t;
	cin >> n >> k;
	t = 240 - k;
	while ((res+(5*cnt)) <= t) {
		res += (5*cnt);
		if ((res+(5*cnt)) <= t) cnt++;
		if (cnt == n) break;
	}
	cout << cnt;
}

#include <algorithm>
#include <string>
#include<iostream>
using namespace std;
#define ll long long

int main() {
	int n, k, total = 0, cn = 0;
	cin >> n >> k;
	for (int i = 1; i <= n; i++) {
		total += 5 * i;
	}
	//cout << "time to do all problems is: " << total << endl;
	int time = 240 - k;
	if (time >= total) {
		cout << n;
	}
	else {
		int j = 1;
		while (time >= 5) {
			time -= 5 * j;
			if (time > 0)
				cn++;
			j++;
		}
		cout << cn;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k;
	cin>>n>>k;
	int z;
	z=240-k;
	int j=1;
	int sum=0;
	while(z>=0)
	{
		z=z-(j*5);
		sum++;
		j++;
		break;
	}
	cout<<sum+1<<endl;
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
	int n,k,total,i,z=1;
	cin>>n>>k;
	total=0;
	for(i=1;i<=n;i++)
	{
		total+=5*i;
		if(total+k>240)
		{
			z=0;}

	}if(z==0)
	cout<<i-2;
	else
	cout<<i-1;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,k,t,a=1,b=0,c=5;
    cin>>n>>k;
    t=240-k;
    for(int i=1; i<=n; i++)
    {
        if(c<=t)
        {
            b++;
            c=c+i*5;
        }

    }
    cout<<b;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;
int n,k,cnt=0,t=5;
int main(){
	cin>>n>>k;
	k=240-k;
	while(k>=0){
		cnt++;
		k-=t;
		t+=5;
	}
	if(cnt>n)
		cout<<n;
	else
		cout<<cnt;

return 0;
}

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        int n,k;
        int trem = 240 - k;
        int a[n+1];
        int i;
        a[0]  = 0;
        for(i=1;i<=n;i++){
            a[i] = a[i-1]+5*i;
            }
            i=1;
        while(a[i]<trem){
            i++;
        }
        cout<<i<<endl;
        return 0;
    }

#include<stdio.h>

int main(){
	int n,k;
    scanf("%d %d",&n,&k);
    k = 240-k;
    int flag = 5;
    int s=0;
    int i=0;
    while(flag+=5){
    if(k-flag>=0) {
        k-=flag;
        s++;
    }
    else    break;
 if(flag/5==n) break;
}
printf("%d\n",s);
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int sum=0;
    int c=0;
    int r=240-m;
    for(int i=1;i<=n;i++)
    {
        sum+=5*i;
        if(sum>=r)
        c++;
    }
    cout<<c;
}

#include<bits/stdc++.h>

using namespace std;

int main() {
  int n, k, x = 0;
  cin >> n >> k;
  int y = 240 - k;
  while(y - (x+1)*5 >= 0) {
    y -= (x+1)*5;
    x++;
  }
  cout << x;
}

/* Bismillahir Rahmanir Rahim */
#include<stdio.h>
int main()
{
    int a,i,j,k,t,s,p;
    scanf("%d %d",&a,&k);
    t=240-k;
    for(i=1;i<=a;i++)
    {
        t=t-(5*i);
        if(t<5)
        {
            s=i;
            break;
        }
    }
    if(s>a)
        s=a;
    printf("%d\n",s);
    return 0;
}

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long n,k;
    cin>>n>>k;
    int bal_t=240-k;
    int i=1;
    while(i<=n && bal_t>0)
    {
        bal_t=bal_t-(i*5);
        i++;
    }
    cout<<i<<endl;
    return 0;
}

#include<iostream>
using namespace std;
int n,a[10],k;
int fn(int t)
{
    if(a[t]>(240-k))
     return 1;
    else
     return 0;
}
int main()
{
    cin>>n>>k;
    int f=0,l,mid;
    a[0]=5;
    for(int i=1;i<n;i++)
     a[i]=((i+1)*5)+a[i-1];
    l=n-1;
    if(a[n-1]<=(mid-k))
     f=n-1;

    else
    while(f<l)
    {
        mid=(f+l)/2;
        if(fn(mid))
         l=mid-1;
        else
         f=mid+1;
    }
    cout<<f;
    return 0;
}

#include <iostream>

using namespace std;

int x ,y ,n , k ;

int main()
{
    cin >> n >> k ;
    x=240-k ;

    for(int i=1 ;i<=n; i++)
    {
        x=x-(i*5) ;
        if(x>0 )
        {
            if(i==n)
            {
                cout << n ;
                break ;
            }
            if((x-5-(5*i)<0))
            {
                cout << i ;
                break ;
            }else if((x-5-(5*i)==0))
            {
                cout << i+1 ;
            }
        }else if(x<0)
        {
            cout << i-1 ;
            break ;
        }

    }

  return 0 ;
}

// Example program
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, t;
    cin >> n >> t;
    int k = 240 - t;
    int sum = 0, i = 1;
    if(n == 1 && k >= 5)
    {
        cout << 1;
        return 0;
    }
    while(sum + i * 5 <= k && i <= n)
    {
        sum += i * 5;
        i++;
        if(i == n && sum + i * 5 <= k)
        {
            cout << i;
            return 0;
        }
        if(sum + i * 5 > k)
        {
            cout << i - 1;
            return 0;
        }
    }
    cout << i;
    return 0;
}

#include <iostream>
using namespace std;
int n,k;
int main(){
	cin>>n>>k;
	int t=240,i=5,j=0;
	t-=k;
	while(k>0){
		t-=i;
		i*=2;
		j++;
		if(t<0)
			j--;
		if(j>=n)
			break;
	}
	cout<<j<<endl;
//	system("pause");
	return 0;
}

#include"stdio.h"

int main()
{
	int n, k;
	scanf("%d", &n);
	scanf("%d", &k);
	int timedu = 239 - k;
	int dembai = 0;
	int i = 1;
	while (timedu > 0 && dembai < n)
	{
		timedu -= i * 5;
		dembai++;
		i++;
		if (timedu < i * 5)
			break;
	}
	printf("%d", dembai);
}

#include <bits/stdc++.h>

using namespace std;
int n,k,dd;
int main()
{
    //freopen("tst.inp","r",stdin);
    cin >> n >> k;
    for (int i=1;i<=7;i++)
         if (5*i*(i+1)/2+k<=240) dd=i;
    cout << dd;
}

#include<cstdio>
#include<cstring>
int main()
{
	int n,k,ans=0;
	scanf("%d %d",&k,&n);
	n=240-n;
	for(int i=1;i<=k;++i)
	{
		n-=i*5;
		if(n<=0)	break;
		++ans;
	}
	printf("%d",ans);
	return 0;
}

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n);
#define vsort(v) sort(v.begin(),v.end());
#define vvsort(v) sort(v.begin(),v.end(),greater<int>());
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
typedef pair<int,int> p;
typedef pair<ll,ll> lp;
typedef priority_queue<int> pq;
typedef priority_queue<int,vector<int>,greater<int> > rpq;
bool is_uruu(int y) {
        return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
}
const ll MOD=1e9+7;
const double PI=acos(-1.0);
//----------------------------------------------------------------------------------------------------------------------------------//

int main(){
        int n,m;
        cin>>n>>m;
        int k=240-m;
        int count=0;
        while(count<=n) {
                if(count*5<=k) {
                        count++;
                        k-=count*5;
                }else{
                        break;
                }
        }
        cout<<count<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
     int n=0,k=0,m=0;
     cin>>n>>k;
     int i;
     for(i=1;i<n;i++)
     {
          m+=5*i;
          if(m+k==240)
          {     cout<<i<<"\n";
               break;
          }
     }
     return 0;
}

#include <iostream>

using namespace std;

int main(){

	int n, k, cm, w;

	int vet[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

	cin >> n >> k;

	if(n < 1 or n > 10 and k < 1 or k > 240){

		return 0;

	}

	if(n == 10){

		cout << 0 << endl;

		return 0;

	}

	for(int i = 0; i < n; ++i){

		vet[i] = 5 * vet[i] + vet[i - 1];

		cm = vet[i];

	}

	if(240 - k < cm){

		cout << n - 1 << endl;

	}else{

		cout << n << endl;

	}

	return 0;

}

#include <iostream>
#include <cmath>

using namespace std;

int main(){
    int n,k;
    cin>>n>>k;
    int time=240-k;
    if(floor(sqrt(time*2.0/5)<n)) cout<<floor(sqrt(time*2.0/5));
    else cout<<n;
    return 0;
}

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,k;
    cin>>n>>k;
    k=240-k;
    if(k>=0 && k<=4)
    cout<<0;
    else if(k>=5)
    {
        for(int i=1;i<=n;i++)
        {
            k=k-5*i;
            if(k>=(5*i+1) && i!=n)
            continue;
            else
            {
            cout<<i;
            break;
        }
        }
    }

}

#include <iostream>

using namespace std;
int main()
{
int i,j,k;
cin>> i >> j;
int t=240-j;
if (t<5){
    cout << 0;
    return 0;
}
for (k=1; k<i;k++){
    t= t - (5*k);
    if (t<5){

        break;
    }

}
 cout << k;

return 0;
}

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

unsigned int availCntMin = 240;
unsigned int n;
unsigned int k;

int getTime(int i) {
    unsigned int ans = 0;
    for (int j = 1; j <= i; ++j) {
        ans += (5 * j);
    }
    return ans;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> k;
    availCntMin -= k;
    unsigned int l = 1, r = n, m;
    while ((r - l) / 2 > 0 ) {
        m = l + (r - l) / 2;
        if (getTime(m) > availCntMin) {
            r = m;
        }
        else if (getTime(m) < availCntMin){
            l = m;
        }
        else {
            break;
        }
    }
    if (getTime(m + 1) <= availCntMin) {
        ++m;
    }
    else if (getTime(m + 2) <= availCntMin) {
        m += 2;
    }
    else if (availCntMin == 0) {
        m = 0;
    }
    cout << m;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	int time;
	cin>>n>>time;
	int valuetime=4*60-time;
	int i=1;
	int cs=0;
	while(valuetime-i*5>=0)
	{
		valuetime-=i*5;
		if(n==i)
		{
			break;
		}
		cs++;
		i++;
	}
	cout<<cs<<endl;
	getchar();
	getchar();
	getchar();
	return 0;
}

#include<stdio.h>
int main()
{
	int n,k,yushu,i;
	scanf("%d %d",&n,&k);
	yushu=240-k;
	i=1;
	while (i<=n&&yushu/(i*5)>0){
		yushu=yushu-i*5;
		i=i+1;
		printf ("%d %d\n",i,yushu);
	}
	printf ("%d\n",i-1);
	return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	int time;
	cin>>n>>time;
	int valuetime=4*60-time;
	int i=1;
	int cs=0;
	while(valuetime-i*5>0&&n>=i)
	{
		valuetime-=i*5;
		cs++;
		i++;
	}
	cout<<cs<<endl;
	getchar();
	getchar();
	getchar();
	return 0;
}

#include <iostream>
using namespace std;
main () {
	int n, k, a = 1200, i = 0, b = 0;
	cin>>n>>k;
	a+=k;

	do 	{
	 		b = a + (5*i);
	 		i++;
		} while (i <= n && b <= 1440);
		cout<<(i-1)<<endl;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,k;
	cin>>n>>k;

	int min_left=240-k;
	int i=0,result=0;
	while(min_left>0)
	{
	    i+=5;
	    min_left-=i;
	    result++;
	    if(result==n)
	    {
	        cout<<n;
	        return 0;
	    }
	}
	cout<<result-1;
	return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int n,t;
    cin>>n>>t;
    int time=240-t;
    int sum=0;
    for(int i=0;i<n;i++)
        sum+=5*i;
    if(sum<time)
        cout<<n<<endl;
    else{
         for(int i=1;i<=n;i++){
             sum+=5*i;
            if(sum<time)
               continue;
            else if(sum==time)
               cout<<i<<endl;
            else
           {
               cout<<i-1<<endl;
               break;
           }
    }
    }
    return 0;
}

//http://codeforces.com/problemset/problem/750/A

#include<bits/stdc++.h>

using namespace std;

int main()
{
	int n,k;
	cin>>n>>k;
	k=240-k;
	k/=5;
	int sum=0,c=1;
	while(sum<k && c<=n)
	{
		sum+=c++;
		cout<<k<<" "<<sum<<" "<<c<<endl;
	}
	if(sum==k || c-1==n)
		c++;
	cout<<c-2<<endl;
	return 0;
}

#include <bits/stdc++.h>

#define LOCAL
#define ll long long
#define lll unsigned long long
#define MAX 1000009
#define mod 1000000007

using namespace std;

int n,m;
int main()
{
    while(~scanf("%d %d",&n,&m)){
       int time = 240 - m;
       if(time<5){
           cout<<0<<endl;
       }else{
        int sum = 0;
        int ans = -1;
        int time = 240 - m;
        for(int i = 1;i<=n;i++){
            sum = sum + i*5;
            if(sum>time){
                ans = i - 1;
                break;
            }
            else if(sum == time){
                ans = i;
                break;
            }
        }
        if(ans == 0){
            ans = n;
        }
        cout<<ans<<endl;
       }
    }
}

// A. New Year and Hurry - CodeForces
#include<bits/stdc++.h>
using namespace std;

void In_Out() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

int get_solve_time(int &number) {
	if (number == 1) {
		return 5;
	} else return ((number / 2) * (10 + (number - 1) * 5));
}

int max_questions(int num, const int &k) {
	int left_time = 240 - k;
	int solve_time = get_solve_time(num);
	// cout << "num: " << num << " solve_time: " << solve_time << endl;
	if (solve_time <= left_time && left_time != 0) {
		return num;
	} else if (solve_time == 0 && left_time == 0) {
		return num - 1;
	} else {
		max_questions(num - 1, k);
	}
}

int main() {
	In_Out();
	int n, k;
	cin >> n >> k;
	cout << max_questions(n, k);
}
// 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.

#include <iostream>
using namespace std;
int main () {
	int n, k, time, i = 1, final = 0;
	cin >> n >> k;
	time = 240 - k;
	while (time > 0) {
		k = 5 * i;
		time -= k;
		i++;
		if (n == i) {
			i += 2;
			break;
		}
	}
	cout << i - 2 << endl;
	return 0;
}

#include <iostream>
using namespace std;

int main()
{
    int n, k, ans = 0;
    cin >> n >> k;
    while(ans <= n && ans * 5 * k <= 240){
        k += (ans * 5);
        ++ans;
    }
    cout << ans - 1 << endl;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n, k;
    cin>>n>>k;
    int res = 0, time = 5, i=1;
    while((240-time)>=k)
    {
        res++;
        i++;
        time+=(5*i);
    }
    cout<<res;
}

#include <iostream>
using namespace std;

int findHowManyQuestions(int n, int mid)
{
	int time = 0;
	int ans = 0;
	for(int i=1; i<=n; ++i)
	{
		time += (i*5);
		if(time <= mid)
		{
			ans += 1;
		}
	}
	return ans;
}

void solve()
{
	int n,k; cin >> n >> k;
	int e = 240 - k;
	int s = 0;
	int ans = 0;
	while(s<=e)
	{
		int mid = (s+e)/2;
		cout << "mid is " << mid << endl;
		ans = findHowManyQuestions(n,mid);
		s = mid+1;
	}
	cout << ans << endl;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	solve();
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n,k,sum=0,co=0,sum1=0;
    cin>>n>>k;
    sum1=240-k;
    if(k==240)
        cout<<0<<endl;
    else
    {
        for(int i=1; i<=n; i++)
        {
            sum+=5*i;
            co++;
            if(sum1<sum+5*(i+1)) break;
        }
    cout<<co<<endl;
    }
    return 0;
}

#include <iostream>
#include <cmath>

using namespace std;

int main(){
    int n,k;
    cin>>n>>k;
    int time=240-k;
    int i=1,sum=0;
    while(sum<=time){
        sum+=5*i;
        i++;
    }
    if(i<n) cout<<i-2;
    else cout<<n;
    return 0;
}

#include<bits/stdc++.h>
using namespace std ;

int z , p , q , w ;

deque<int>vc,cv;

string a = "aeiouy";

int main( ) {

    int n , m ;
    cin >> n >> m ;
    if(m>=238){
        cout<<0<<endl;
        return 0 ;
    }
    int b[10000];
    int k = ( 240 - m ) / 5 ;
    for(int i = 1 ; i < 10000 ; i ++ ){
        b[i]=(i*(i+1))/2;
    }
    for(int i = 0 ; i < 10000 ; i ++ ){
        if(k<=b[i]){
            cout<<min((i+1),n)<<endl;
            return 0 ;
        }
        k -= b[i];
    }

}

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,k;
	cin>>n>>k;
	int q=240-k;
	vector<int>a(n);
	a[0]=5;
	for(int i=1;i<n;++i){
		a[i]=(i+1)*5+a[i-1];
	}
	bool flag=false;
	int key=q;
	int l=0;
	int r=n-1;
	int m;
	while((l<=r)&&(flag!=true)){
		m=round((l+r)/2.);
		if(a[m]==key)flag=true;
		if(a[m]>key)r=m-1;
		else l=m+1;
	}
	if(flag)cout<<m+1;
	else if(n>5)cout<<m+1;
	else cout<<m;
	return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int prob, party,left,left_now,i;
    cin>>prob;
    if (prob==10)
    prob--;
    cin>>party;
    left = 240-party;
    if (left>5){

        for(i=1;i<prob;i++)
    {
        left = left-(5*i);

        if(left<5*(i+1))
        {
            cout<<i;
            return 0;
        }

    }

        cout<<i;
    }
    else
    cout<<0;

    return 0;
}

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
int n,k;

int main()
{
    scanf("%d %d",&n,&k);
    int last = 240 - k;
    int res = 0;
    for(int i = 1; i <= n; i++)
    {
        if( i*5 < last)
        {
            last -= i*5;
            res++;
        }
        else
            break;
    }
    printf("%d\n",res);
    return 0;
}

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int bs(int n,int k){
    k=240-k;
    int l=1,h=n,c;
    while(l<=h){
        int m=(l+h)/2;
        int t=(5*(m)*(m+1))/2;
        if(t==k){
            c=m;
            return c;
        }
        if(t<k){
            c=m;
            l=m+1;
        }
        else{
            h=m-1;
        }
    }
    return c;
}
int main(){
    int n, k;
    cin>>n>>k;
    cout<<bs(n,k);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
// #ifndef ONLINE_JUDGE
// 	freopen("in.txt","r",stdin);
// 	freopen("out.txt","w",stdout);
// #endif
	int n , time ; cin >> n >> time ;
	int time_left = 240 - time ;
	int count = 1 ;
	int sum = 0 ;
	for(int i = 1 ; i <= n ; i++)
	{
		int prob = 5*i ;
		sum += prob ;
		cout << sum << " " << prob << " " << time_left << endl;
		if(sum <= time_left)
		{
			count ++;
			time_left -= prob ;
		}
		else break;
	}
	if(sum>5)cout << count ;
    else cout << 0 ;
	return 0 ;
}

#include<iostream>
using namespace std;
int main(){
    int n,k,i;
    cin>>n>>k;
    n=n-k;
    for(i=1;;i++){
        n-=5*i;
        if(n<0) break;
    }
    cout<<i-1;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,rem,i,ans=0;
    cin>>n>>k;

    rem=240-k;
    for( i=1; i<=n && rem>=0 ; i++)
    {
        rem=rem-(5*i);
        ans++;

    }
    cout<<ans<<endl;
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int n, r;
int main()
{
    cin >> n >> r;
    r = 240 - r;
    int i = 1;
    int dem = 0;
    while(dem <= r){
        dem += 5*i;
        if(dem > r)
            break;
        i++;
    }
    cout << i - 1;
}

#pragma comment(linker, "/STACK:10000000000")
#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <map>
#include <chrono>
#include <set>
#include <stack>
#include <vector>
#include <time.h>
#include <random>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <complex>
#define rt return
#define mp make_pair
#define endl '\n'
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#define rep(x) for (int rep_iter = 0; rep_iter < x; ++rep_iter)
#define fnd(x, y) (x.find(y) != x.end())
#define fndv(x, y) (find(all(x), y) != end(x))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<db, db> pdd;
typedef unsigned char bt;
typedef unsigned int uint;
const int MOD = 1000000007;
const int INF = 1000000007LL;
const ll INF2 = 1LL << 62LL;
const long double EPS = 1e-9;
#ifdef _DEBUG
const int SIZE = 120;
#endif
#ifndef _DEBUG
const int SIZE = 500010; //200010
#endif
mt19937 rng(time(0));
uniform_int_distribution<int> uid(-1000000000, 1000000000);

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n, k, ans = 0;
	cin >> n >> k;
	k = 240 - k;
	for (int i = 1; i * 5 <= k; ++i) {
		ans = i;
		k -= i * 5;
	}
	cout << ans;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {

	int n, k;
	cin >> n >> k;
	if (k == 240) {
		cout << 0;
		return 0;
	}
	int cnt = 0, ans = 0;
	for (int i = 1; i <= n; i++) {
		if (cnt + (i * 5) > (240 - k)) {
			ans = i - 1;
			break;
		}
		cnt += (i * 5);
	}
	if (!ans) {
		cout << n;
	}
	else {
		cout << ans;
	}
	return 0;
}

#include <iostream>
using namespace std;
int main ()
{
    int n,k,ile_spr(0);
    cin >> n >> k;
    for(int i=0; i<n; i++){
        int d;
        d+=5;
        ile_spr+=d;
    }
        while(ile_spr+k>=240){
            ile_spr-=5;
            n--;
    cout << n;
            return 0;
        }

}

#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,i=1;
cin>>n>>k;
int sum=0;
int p=240-k;
while(p>sum && i!=n){
sum=sum+5*i;
i++;
}cout<<i-2<<endl;
return 0;
}