while n = gets.try(&.to_i?) ans = n * (n + 1) // 2 puts ans end