def total n = gets.to_i x = 0 i = 0 while x <= n do i = i + x x = x + 1 end puts i end total