#include #define DEF_INPUT_MIN (1) #define DEF_INPUT_MAX (100) int main(void) { int itr = 0; int input = 0; int output = 0; while(1) { scanf("%d", &input); if(input < DEF_INPUT_MIN || input > DEF_INPUT_MAX) { continue; } for (itr = 0; itr <= input ; itr++) { output += itr; } printf("%d\n", output); break; } return 0; }