2nd Test case comes wrong

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

return 0;
}

ip:3 222
op:2(verdict :correct)
ip2:4 190
op:4(verdict: incorrect mine comes 3)
ip3:7 1
op:7(verdict:correct)
what is wrong in this code

question is new year and hurry