#include<iostream>
using namespace std;
int main()
{
long long n;
cout<<"Enter a positive number :";
cin>>n;
 if (n>=1 && n<=1000000)
 {
     long long sum = n*(n+1)/2;
     cout<<"the sum of the first "<<n<<"natural numbers are:"<<sum<<end;
     }
     else
     {
         cout<<"Invalid input"<<endl;
     }
     return 0;
}