num = gets.to_i #合計用変数 sum = 0 #カウント変数 i = 1 #1から標準入力で受け付けた数字まで1ずつ増やしていく while i <= num sum += i i += 1 end puts sum