num = gets.to_i cnt = 1 res = 0 while cnt <= num do res += cnt cnt += 1 end puts res