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

	return 0;
}

/**************************************************************
	Problem: 1146
	User: zhuanghaoxiang
	Language: C++
	Result: Compile Error
****************************************************************/