#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,n) for(int i = 0;i<((int)(n));i++) #define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++) #define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--) #define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--) typedef long long ll; typedef pair mp; ll mod = 1e9+7; ll inf = 1e18; //AC map a; int main(void){ ll n,ans=0; cin>>n; while(n>0){ ireg(i,1,sqrt(2*n)+10){ if(i*(i+1)/2<=n){ n-=i*(i+1)/2; ans++; break; } } } cout<