while line = gets n = line.not_nil!.to_i puts n * (n + 1) // 2 end