/*
TASK:sum
LANG:C++
*/
#include <iostream>
#include <math.h>
using namespace std;

long long n,l,k,i,t,br=0;
double b,temp;
int main()
{   
    cin>>n;
    n=2*n;
    t=n/2+1;
    for (i=0;i<t;i++)
       {temp=i*(i+1);
        temp=sqrt(1+4*(n+temp));
        if ((temp-floor(temp))<0.000001)
          {br++;
           b=(temp-1)/2;
           if ((b-i)<2) br--;
 //           else cout<<i+1<<".."<<b<<" YES\n";
          }
        }
         
    cout<<br<<endl;
  //  system("pause");
    return 0;
}
