#for i in range(20):
#    if i != 13:
#        print i,
#    else:
#        print "hello"


#for i in range(0, 110, 10):
#    print i

#for i in range(1,10,1):
#    if i%2 ==1:
#        print i 

#for i in range(10,-1,-1):
#    if i == 0:
#       print "Blastoff!"
#    else:
#        print i,

#fruits = ["apples", "oranges", "bananas"]
#for i in fruits:
#    print i,

#for i in [0,1,2]:
#    print fruits[i]

num = int(raw_input("What is your number?"))

#def sum_nums(num):
#    sum = 0
#    for i in range(0,num):
#        sum += i
#    return sum

#print sum_nums(num)


def sum_nums(num):
    sum = 0
    for i in range(0,num):
        sum += i
    return sum

print sum_nums(num)













