#include<stdio.h>
#include<math.h>
int main()
{
int i,sum=0,n;
{
if(n<=0)
{
for(i=1;i>=n;i--)
sum+=i;
}
else
{
sum=((n*n)+n)/2;
}
}
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8bWF0aC5oPgppbnQgbWFpbigpCnsKICAgIGludCBpLHN1bT0wLG47CiAgICBzY2FuZigiJWQiLCZuKTsKICAgIGlmKGFicyhuKTw9MTAwMDApCiAgICB7CiAgICAgICAgaWYobjw9MCkKICAgICAgICB7CiAgICAgICAgICAgIGZvcihpPTE7aT49bjtpLS0pCiAgICAgICAgICAgICAgICBzdW0rPWk7CiAgICAgICAgfQoKICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBzdW09KChuKm4pK24pLzI7CiAgICAgICAgfQoKICAgIHByaW50ZigiJWQiLHN1bSk7CgogICAgfQogICAgcmV0dXJuIDA7Cn0K