  
#include<iostream.h>
void main() 
{
       int max;
       cout << "Please enter max:  ";
       cin >> max;
       cout << "\n";

       int count = 0; 
       for(int i=0; i< max; i++)
          for(int j=0; j <= i; j++)
            count++;

        cout << "           " << count << "\n" ;
}
