#include <stdio.h> #include <math.h> int main(){ int k; int i=1; long long sum=0; scanf("%d",&k); while((1+i)i/2<k&&(1+i+1)(i+1)/2<=k){ i++; } for(int j=1;j<=i;j++){ sum+=jj; } sum+=(i+1)(k-(1+i)*i/2); printf("%lld",sum); return 0; }