[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

let solve s t = (s + t) * t / 2

[<EntryPoint>]
let main _ =
    let n = read int
    solve 1 (n - 1)
    |> printfn "%i"
    0