using System; using System.Linq; public class Program { static void Main() { var input = Console.ReadLine(); var n = Convert.ToInt32(input); var total = 0; foreach(var i in Enumerable.Range(1, n)) { total += i; } Console.WriteLine(total.ToString()); } }