CodeEff/ECCO huggingface dataset:
# Original solution
N=int(eval(input()))
M=0
for i in range(1,N+1):
    j=(i+1)%(N+1)
    if j==0:
        j=1
    # print(i,j,i%j)
    M+=i%j
print(M)

# Optimized solution
N=int(eval(input()))
print((N*(N-1)//2))
# Original solution
n = int(eval(input()))

cnt = 0

for c in range(n) :
    cnt += c
print(cnt)

# Optimized solution
n = int(eval(input()))

cnt = 0

if (n-1)%2 == 0 :
    cnt = ((n-1)//2) * (n)
else :
    cnt = ((n-1)//2) * (n) + n//2

print(cnt)
# Original solution
import sys
input = sys.stdin.readline
#-------------------------------------
n = int(eval(input()))
v = n
ammount = 0
for i in range(v):
    ammount += v
    v -= 1

print((ammount-n))

# Optimized solution
import sys
input = sys.stdin.readline
#-------------------------------------
n = int(eval(input()))
print(((n+1) * (n//2) + (n%2)*(n//2+1) - n))
# Original solution
N = int(eval(input()))
n = 0
for m in range(N - 1, 0, -1):
    n = n + m
print(n)


# Optimized solution
N = int(eval(input()))
print(((N * (N - 1)) // 2))
# Original solution
a = int(eval(input()))
s = 0
for i in range(a+1):
    s+=i
print((s-a))

# Optimized solution
a = int(eval(input()))
s = a*(a-1)//2
print(s)
# Original solution
def main():
    n = int(eval(input()))
    print((sum(range(n))))


main()


# Optimized solution
def main():
    n = int(eval(input()))
    print(((n - 1) * n // 2))


main()
# Original solution
n = int(eval(input()))
ans = 0
for i in range(1,n):
  ans += i%(i+1)
print(ans)

# Optimized solution
n = int(eval(input()))
print((int((n)*(n-1)//2)))
# Original solution
import sys
input = sys.stdin.readline

#単入力
n=int(eval(input()))

l=[i for i in range(1,n+1)]
ll=l
ans=0
for i in range(len(l)):
    if i==n-1:
        break
    ans+=ll[i]%l[i+1]
    #if i==0:
        #del ans[0]

print(ans)

# Optimized solution
import sys
input = sys.stdin.readline

#単入力
n=int(eval(input()))
print((n*(n-1)//2))
# Original solution
N=int(eval(input()))
if N%2==0:
  print((N//2*(N-1)))
else:
  print(((N-1)//2*N))

# Optimized solution
N=int(eval(input()))
if N%2==0:
  print((int(N/2)*(N-1)))
else:
  print((int((N-1)/2)*N))
# Original solution
from collections import deque
n = int(eval(input()))
seque = deque([i for i in range(1,n+1)])
a = seque.popleft()
seque.append(a)
# 1 2 3 4 5 6 7 8 9 10 11 12 13
# 2 3 4 5 6 7 8 9 10 11 12 13 1 
# print(seque)
ans = 0
for i in range(1,n+1):
    ans += i%seque[i-1]
print(ans)

# Optimized solution
n = int(eval(input()))
ans = (n)*(n-1)//2
print((int(ans)))
# Original solution
N = int(eval(input()))

if N <= 1:
    print("0")
    exit()

cnt = 0
for i in range(2,N+1):
    cnt += (i-1)

print(cnt)


# Optimized solution
N = int(eval(input()))
print(((N-1)*(N)//2))
# Original solution
n = int(eval(input()))
a = [i for i in range(1, n + 1)]
print((sum(a) - n))

# Optimized solution
n = int(eval(input()))
ans = n * (n + 1) // 2 - n
print(ans)
# Original solution
N = int(eval(input()))
I = [x for x in range(1,N+1)]
P = [x+1 for x in range(1,N)]
P.append(1)
M = [x % y for (x,y) in zip(I,P)]
print((sum(M)))

# Optimized solution
N = int(eval(input()))
I = [x%(x+1) for x in range(1,N+1)]
ans = sum(I) - N
print(ans)
# Original solution
N = int(eval(input()))
a = [i+1 for i in range(N-1)]
print((sum(a)))

# Optimized solution
N = int(eval(input()))
if N%2==0:
    print((N//2+N*((N-1)//2)))
elif N%2!=0:
    print((N*(N//2)))
# Original solution
N = int(eval(input()))
ans = 0

for i in range(1, N):
    ans += i

print(ans)


# Optimized solution
N = int(eval(input()))
print(((N - 1) * N // 2))
# Original solution
N = int(eval(input()))
ans = 0

for i in range(N):
    ans += i

print(ans)


# Optimized solution
N = int(eval(input()))
print((N * (N-1) // 2))
# Original solution
N = int(eval(input()))

x = [i + 1 for i in range(N)]

print((sum(x) - N))


# Optimized solution
N = int(eval(input()))


print((N*(N + 1) // 2 - N))
# Original solution
N = int(eval(input()))
Mmax = 0
for i in range(N):
    Mmax += i
#a[0] = a[-1]

print(Mmax)

# Optimized solution
N = int(eval(input()))

a = N/2
b = int(N/2)
if not(N%2 == 0):
    Mmax = N*b
elif N%2 == 0:
    Mmax = N*(b-1) + b



print(Mmax)
# Original solution
N=int(eval(input()))
result=0
for i in range(N):
    result+=i

print(result)

# Optimized solution
N=int(eval(input()))

result=(N-1)*(N)//2
print(result)
# Original solution
import math
N = int(eval(input()))
print(((N*(N-1)+2)//2-1))


# Optimized solution
N = int(eval(input()))
ans = ((1+N-1)*(N-1))//2
print(ans)
# Original solution
N=int(eval(input()))
print((sum(range(1,N))))

# Optimized solution
N=int(eval(input()))
print((N*(N-1)//2))
# Original solution
n = int(eval(input()))
print((sum(range(n))))


# Optimized solution

n = int(eval(input()))

if n % 2:
    print((n * (n - 1) // 2))
else:
    print((n * (n // 2 - 1) + n // 2))
# Original solution
n = int(eval(input()))
lis = [i+1 for i in range(n-1)]
print((sum(lis)))

# Optimized solution
n = int(eval(input()))
print((n*(n-1) // 2))
# Original solution
n = int(eval(input()))
result = 0

for i in range(1, n):
    result += i
print(result)

# Optimized solution
n = int(eval(input()))
print((int((n-1)*(n)//2)))
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import stdin
import math

# 標準入力をスペースで区切って、intに変換 listに収納
int_list  = [int(x) for x in stdin.readline().rstrip().split()]

N = int_list[0]

total = 0
for i in range(N):
    total+=i

print(total)



# Optimized solution
N = int(eval(input()))
total=int(N*(N-1)//2)
print(total)
# Original solution
"""
考え方

N-1までの値を合計した値が答え
"""

N = int(eval(input()))

ans = 0
for i in range(1,N):
  ans += i

print(ans)

# Optimized solution
N=int(eval(input()))

ans = N*(N-1)
ans //= 2

print((int(ans)))
# Original solution
n = int(eval(input()))

ans = 0

result = 0;
for i in range(1, n):
  result += i
print(result)



# Optimized solution
n = int(eval(input()))
print(((n * (n-1)) // 2))
# Original solution
n = int(eval(input()))
ans = 0
for i in range(1, n):
    ans += i
print(ans)

# Optimized solution
n = int(eval(input()))
if n%2 != 0:
    print((n*(n//2)))
else:
    print((n*(n//2) - n//2))
# Original solution
N = int(eval(input()))

print((sum(range(1, N))))

# Optimized solution
N = int(eval(input()))

print(((N-1) * N // 2))
# Original solution
n = int(eval(input()))
ans = 0
for i in range(n-1, 0, -1):
  ans += i
print(ans)

# Optimized solution
n = int(eval(input()))
ans = (n-1)*n//2
print(ans)
# Original solution
N = int(eval(input()))
s = [i+1 for i in range(N)]
print((sum(s[:-1])))


# Optimized solution
N = int(eval(input()))
ans = ((N-1)*N)//2
print(ans)
# Original solution
N = int(eval(input()))
mod = 0
if N == 1:
  print((0))
else:
  print((sum(range(2,N))+1))
  

# Optimized solution
N = int(eval(input()))
mod = 0
if N == 1:
  print((0))
else:
  print((N+N*(N-1)//2-N))
# Original solution
n1 = int(eval(input()))

r1 = 0
for i1 in range(n1):
    r1 += i1

print(r1)

# Optimized solution
n1 = int(eval(input()))

r1 = (n1 * (n1 - 1)) // 2

print(r1)
# Original solution
n=int(eval(input()))
su=0
for i in range(n):
    su+=i
print(su)

# Optimized solution
n = int(eval(input()))
n = n-1
print((n*(n+1)//2))
# Original solution
from decimal import *

N = int(eval(input()))
# if N == 1:
#     print("0")
#     exit()
ans = Decimal((Decimal(N-1) * Decimal(N) / 2))
print((int(ans)))


# Optimized solution


N = int(eval(input()))
# if N == 1:
#     print("0")
#     exit()
ans = (N-1)*N//2
print((int(ans)))
# Original solution
N = int(eval(input()))
P = [i for i in range(1, N + 1)]
print((sum(P) - max(P)))

# Optimized solution
N = int(eval(input()))
print((N * (N - 1) // 2))
# Original solution
N = int(eval(input()))
nums = [i for i in range(1,N+1)]
new = nums[1:] + nums[:1]
ans = 0
for x,y in zip(nums,new):
    ans += x % y
print(ans)

# Optimized solution
N = int(eval(input()))
print((N * (N-1) // 2))
# Original solution
N = int(eval(input()))

ans = 0
for n in range(1, N):
    ans += n
print(ans)


# Optimized solution
N = int(eval(input()))

print(((N-1)*(1+N-1)//2))
# Original solution
def main():
    _sum = 0
    N = int(eval(input()))
    for i in range(1, N):
        _sum += i

    print(_sum)

if __name__ == '__main__':
    main()

# Optimized solution
N = int(eval(input()))
print(((N-1)*(N) // 2))
# Original solution
N = int(eval(input()))

ans = 0
for i in range(1,N) :
    ans += i
print(ans)



# Optimized solution
N = int(eval(input()))

ans = (N-1)*N//2
print(ans)
# Original solution
#<D>
import itertools
N = int(eval(input()))
num = [n for n in range(1, N + 1)]
print((list(itertools.accumulate(num))[N - 1] - N))
    


# Optimized solution
N = int(eval(input()))
print(((N - 1) * N // 2))
# Original solution
N = int(eval(input()))
m = []
for i in range(1, N):
    m.append( i % (i+1) )
print((sum(m)))

# Optimized solution
N = int(eval(input()))
ans = ((N - 1) * N ) // 2
print(ans)
# Original solution
# -*- coding: utf-8 -*-

N = int(eval(input()))
tempM = 0
M = []

for i in range(N):
    for p in range(i+1):
        temp = p % (i+1)
        if temp > tempM:
            tempM = temp
    M.append(tempM)

print((sum(M)))

# Optimized solution
# -*- coding: utf-8 -*-

N = int(eval(input()))

print((int(N*(N-1)//2)))
# Original solution
n = int(eval(input()))
res = 0
for i in range(n):
    res += i
print(res)

# Optimized solution
n = int(eval(input()))
print((n*(n-1)//2))
# Original solution
import math

N = int(input().split()[0])

n_list = [i for i in range(1, N+1)]
p_list = n_list[1:] + [1]

ans_1 = sum(n_list[:-1])
if (N - 1) % 2 == 0:
    ans = int(N * ((N - 1) / 2))
else:
    mean_v = math.floor((N - 1) / 2) + 1
    ans = int(N * math.floor((N - 1) / 2))
    ans += mean_v

print(ans)


# Optimized solution
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

ans = N * (N-1) // 2

print(ans)
# Original solution
print((sum([i for i in range(int(eval(input())))])))

# Optimized solution
n = int(eval(input()))
print((n*(n-1)//2))
# Original solution
n = int(eval(input()))
ans = 0
for i in range(1, n):
    ans += i
print(ans)

# Optimized solution
n = int(eval(input()))
ans = (n - 1) * n // 2
print((int(ans)))
# Original solution
from decimal import Decimal
n = int(eval(input()))
ans = int((n / Decimal(2)) * (n - 1))
print(ans)

# Optimized solution
n = int(eval(input()))
ans = int(n * (n - 1) // 2)
print(ans)
# Original solution

n = int(eval(input()))
ans = 0

for i in range(n):
    ans += i

print(ans)


# Optimized solution
n = int(eval(input()))
ans = ((n-1)*n)//2

print(ans)
# Original solution
n=int(eval(input()))
ans=0
for i in range(1,n):
    ans+=i
print(ans)
          

# Optimized solution
n=int(eval(input()))
ans=n*(n-1)//2

print(ans)
# Original solution
n=int(eval(input()))
cnt=0
for i in range(n):
    cnt +=i
print(cnt)

# Optimized solution
n=int(eval(input()))
print((n*(n-1)//2))
# Original solution
n=int(eval(input()))
A=[i+1 for i in range(n)]
print((sum(A)-n))

# Optimized solution
n=int(eval(input()))
print((n*(n+1)//2-n))
# Original solution
N = int(eval(input()))

ans = 0
for i in range(1,N):
    ans += i
print(ans)


# Optimized solution
N = int(eval(input()))

ans = ((N-1)*N//2)

print(ans)
# Original solution
N = int(eval(input()))
print((sum(range(N))))

# Optimized solution
N = int(eval(input()))
print((N * (N-1) // 2))
# Original solution
n = int(eval(input()))
arr = [i for i in range(1, n)]
print((int(sum(arr))))

# Optimized solution
n = int(eval(input()))

res = n * ((n - 1) // 2)
if (n - 1) % 2 == 1:
    res += ((n - 1) // 2) + 1

print((int(res)))
# Original solution
s=eval(input())
a=int(s)
b=0
if a==1:
  print((0))
else:
  for i in range(a):
    b+=i
  print(b)

# Optimized solution
s=eval(input())
a=int(s)
b=0
if a==1:
  print((0))
else:
  b=((a-1)*a)//2
  print(b)
# Original solution
N = int(eval(input()))

myans = 0

for i in range(N):
    myans += i
    
print(myans)

# Optimized solution
N = int(eval(input()))

N = N -1

mysum = ((N*(N+1))//2)

print(mysum)
# Original solution
# 2019/09/01

n=int(eval(input()))
cnt=0
for i in range(1,n):
    cnt+=i
print(cnt)

# Optimized solution
# 2019/09/01

n=int(eval(input()))

ans=(1+n-2)*n//2
print(ans)
# Original solution
N = int(eval(input()))

print((N*(N-1)//2))

# Optimized solution
N = int(eval(input()))

print((N*(N+1)//2 -N))
# Original solution
n = int(eval(input()))
print((n*(n-1)//2))

# Optimized solution
n = int(eval(input()))
print(((n - 1) * n // 2))
# Original solution
n=int(eval(input()))
count=0
for i in range(1,n):
    count+=i
print(count)

# Optimized solution
n=int(eval(input()))
print((n*(n-1)//2))
# Original solution
n = int(eval(input()))
ans = 0
for i in range(n-1):
    ans += i + 1
if n == 1:
    ans = 0
print(ans)

# Optimized solution
n = int(eval(input()))
ans = 0
ans = (1 + n-1)*(n-1)//2
if n == 1:
    ans = 0
print(ans)
# Original solution
n = int(eval(input()))
print((sum(range(n))))

# Optimized solution
n = int(eval(input()))
 
print((int(n * (n - 1) // 2)))
# Original solution
n = int(eval(input()))
# a= 4, 1, 2, 3
# b= 1, 2, 3, 4 # modのmaxは 0, 1, 2, 3 なので最大6
# ----------
#    0, 1, 2, 3 
#print(int(n*(n-1)/2))  # 合わない...
print((sum([b%a for a, b in zip([i for i in range(1, n+1)], [n] + [i for i in range(1, n)])])))

# Optimized solution
n = int(eval(input()))
#答えが違う
#print(int(n*(n-1)/2))  # 合わない...
#print(int(n*(n-1)//2))  # 合わない...
print((n*(n-1)//2))
# Original solution
N=int(eval(input()))
x=0
for i in range(1,N):
    x+=i

print(x)

# Optimized solution
N=int(eval(input()))
x=int(N*(N-1)//2)
print(x)
# Original solution
N=int(eval(input()))
ans=0
for i in range(1,N):
    ans+=i
print(ans)

# Optimized solution
N=int(eval(input()))

print(((N-1)*N//2))
# Original solution
n=int(eval(input()))
ans=0
for i in range(1,n):
    ans+=i
print(ans)

# Optimized solution
n=int(eval(input()))
print((n*(n-1)//2))
# Original solution
n=int(eval(input()))
x=0
for i in range(n):
  x=x+i
print(x)

# Optimized solution
n=int(eval(input()))
print((n*(n-1)//2))
# Original solution
from decimal import Decimal
N = int(eval(input()))
print((Decimal(N * (N - 1) // 2)))

# Optimized solution
from decimal import Decimal
N = int(eval(input()))
print((int(Decimal(1/2) * Decimal(N) * Decimal(N - 1))))
# Original solution
n = int(eval(input()))
a = [i + 1 for i in range(n)]
p = a[1:] + [a[0]]
print((sum([a[i] % p[i] for i in range(n)])))

# Optimized solution
n = int(eval(input()))
print((n * (n - 1) // 2))
# Original solution
N=int(eval(input()))
ans=0
for i in range(N):
    ans+=i
print(ans)



# Optimized solution
N=int(eval(input()))
ans=((N-1)*N)//2
print(ans)
# Original solution
n = int(eval(input()))
if n % 2:
    temp = int((1 + n-1) * ((n-1) / 2))
else:
    temp = int((1 + n-1) * ((n-1) // 2) + -(-n // 2))
for i in range(1, n):
    if n % (i+1) > i:
        temp += n-i
print(temp)

# Optimized solution
n = int(eval(input()))
print((n * (n-1)//2))
# Original solution
n = int(eval(input()))
count = 0
for i in range(n):
    count += i
print(count)

# Optimized solution
n = int(eval(input()))
print((n * (n - 1) // 2))
# Original solution
n_2 = int(eval(input()))

max_amaries = []

for j in range(1,n_2+1):
    if j == n_2:
        print((sum(max_amaries)))
    max_amari = j % (j+1)
    max_amaries.append(max_amari)

# Optimized solution
n_2 = int(eval(input()))

c = 0
for j in range(1,n_2+1):
    c += j
    
print((c - n_2))
# Original solution
from itertools import accumulate
n = int(eval(input()))
a = list(accumulate(list(range(n))))
print((a[-1]))

# Optimized solution
n = int(eval(input()))
print((n*(n-1)//2))
# Original solution
N = int(eval(input()))
if N == 1:
  print("0")
else:
  nums = [i for i in range(1,N)]
  print((sum(nums)))


# Optimized solution
N = int(eval(input()))
if N == 1:
  print("0")
else:
  ans = 0
  for i in range(N):
    ans += i
  print(ans)
# Original solution
N = int(eval(input()))
if N == 1:
  print("0")
else:
  ans = 0
  for i in range(N):
    ans += i
  print(ans)


# Optimized solution
N = int(eval(input()))
if N == 1:
  print("0")
else:
  ans = (N * (N-1))//2
  print(ans)
# Original solution
N = int(eval(input()))
ans = sum(range(N))
print(ans)

# Optimized solution
N = int(eval(input()))
ans = (N-1)*N//2
print(ans)
# Original solution
# d
n = int(eval(input()))
print((sum(i%(i%n+1) for i in range(1, n+1))))

# Optimized solution
# d
n = int(eval(input()))
print((n*(n-1)//2))
# Original solution
N = int(eval(input()))

mod = (N-1)*N/2
for i in range(1,N+1):
    if N%i == N:
        break

print((int(mod+N-i)))


# Optimized solution
n = int(eval(input()))
print((n*(n-1)//2))
# Original solution
n = int(eval(input()))
ans = 0
for i in range(1, n//2+1):
    ans += n+1
ans -= n
if n%2 == 1:
    ans += n//2 + 1
print(ans)


# Optimized solution
n = int(eval(input()))
ans = (n+1) * (n//2) - n
if n%2 == 1:
    ans += n//2 + 1
print(ans)
# Original solution
n=int(eval(input()))
ans=0

if n==1:
    print((0))
    exit()
    
for i in range(n):
    ans+=i
print(ans)

# Optimized solution
n=int(eval(input()))

if n==1:
    print((0))
    exit()
    

print(((n*(n-1))//2))
# Original solution
# -*- coding: utf-8 -*-

n = int(eval(input()))
s = n - 1

ans = 0
for i in range(s+1):
    ans += i
print(ans)

# Optimized solution
# -*- coding: utf-8 -*-

n = int(eval(input()))
s = n - 1

print((s*(s+1)//2))
# Original solution
# -*- coding: utf-8 -*-
n = int(eval(input()))

tmp = [i for i in range(1, n + 1)]
print((sum(tmp) - n))


# Optimized solution
# -*- coding: utf-8 -*-
n = int(eval(input()))

su = n * (n + 1) // 2
print((su - n))
# Original solution
def main():
    N = int(eval(input()))
    ans = 0
    data = [i for i in range(1, N+1)]
    data_c = data.copy()
    tmp = data_c.pop(0)
    data_c.append(tmp)

    for i in range(N):
        ans += data[i]%data_c[i]

    print(ans)

    return 0
if __name__ == '__main__':
    main()

# Optimized solution
def main():
    N = int(eval(input()))
    ans = 0

    for i in range(1, N+1):
        if i != N:
            ans += i%(i+1)

    print(ans)

    return 0
if __name__ == '__main__':
    main()
# Original solution
def main():
    N = int(eval(input()))
    ans = 0

    for i in range(1, N+1):
        if i != N:
            ans += i%(i+1)

    print(ans)

    return 0
if __name__ == '__main__':
    main()

# Optimized solution
def main():
    N = int(eval(input()))
    ans = (N-1)*N//2

    print(ans)

    return 0
if __name__ == '__main__':
    main()
# Original solution
# 2020/08/16
# AtCoder Beginner Contest 139 - D

# Input
n = int(eval(input()))

# Calc
asum = 0
# for i in range(1, n+1):
#     asum = asum + (n + 1 - i) % i
for i in range(1, n):
    asum = asum + i

# Output
print(asum)


# Optimized solution
# 2020/08/16
# AtCoder Beginner Contest 139 - D

# Input
n = int(eval(input()))

# Calc
ans = n * (n-1) // 2

# Output
print(ans)
# Original solution
# ABC-139-D
N = int(eval(input()))

A = [i for i in range(1, N)]
print((sum(A)))

# Optimized solution
# ABC-139-D
N = int(eval(input()))

# TLEになった
# A = [i for i in range(1, N)]
# print(sum(A))

#sum(N) = ((N+1)*N)/2なのでこちらで実施。
print(((N * (N-1))//2))
# Original solution
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return

def gau(n):
    return n*(n+1)/2

def main():
    N = int(input())
    mods = [ i+1for i in range(N)]
    test = [mods[-1]]+mods[:-1]
    print(int(gau(N-1)))

if __name__ == "__main__":
    main()


# Optimized solution
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return

def gau(n):
    return n*(n+1)//2

def main():
    N = int(input())
    if (N==1):
        print(0)
    else:
        print(gau(N-1))

if __name__ == "__main__":
    main()
# Original solution
from sys import stdin
from itertools import accumulate
n = int(stdin.readline().rstrip())
li = [p for p in range(1,n)]
if n == 1:
    print((0))
else:
    lin = list(accumulate(li))
    print((lin[-1]))

# Optimized solution
from sys import stdin
n = int(stdin.readline().rstrip())
if n == 1:
    print((0))
else:
    point = 0
    for i in range(1,n):
        point += i
    print(point)
# Original solution
from sys import stdin

n = int(stdin.readline().rstrip())
point = 0
for i in range(1,n+1):
    point += i%n
print(point)

# Optimized solution
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)
# Original solution
n = int(eval(input()))

count=0

for i in range(n):
    count+=i

print(count)

# Optimized solution
n = int(eval(input()))

n-=1

print((n*(n+1)//2))
# Original solution
N = int(eval(input()))
array = [i for i in range(1, N+1)]
num = 0

for i in range(N-1):
    num += i + 1

print(num)

# Optimized solution
N = int(eval(input()))
print((N * (N-1) // 2))
# Original solution
from collections import deque
n = int(eval(input()))
r = list(range(1, n+1))
p = deque(r)
p.rotate(-1)
print((sum(i%p[i-1] for i in r)))

# Optimized solution
n = int(eval(input()))
print((sum(i%(i+1) for i in range(1, n))))
# Original solution
sum = 0
N = int(eval(input()))
for n in range(N):
    sum += n
print(sum)



# Optimized solution
N = int(eval(input()))

def summation(num):
    factor = divmod(num, 2)
    return (int(num / 2) * (1 + num)) + (factor[0] + 1) * factor[1]

tmp = int(summation(N))
print((tmp - N))
# Original solution
# -*- coding: utf-8 -*-

N = int(input().strip())

print((sum(int(i) for i in range(N))))

# Optimized solution
# -*- coding: utf-8 -*-

N = int(input().strip())
print(((N-1)*N//2))
# Original solution
n=int(eval(input()))

ans=0
for i in range(n):
  ans+=i
  
print(ans)

# Optimized solution
n=int(eval(input()))

ans=n*(n-1)//2
  
print((int(ans)))
# Original solution
N, W = list(map(int, input().split()))
wv = [tuple(map(int, input().split())) for _ in range(N)]
w1 = wv[0][0]
l1, l2, l3, l4 = [], [], [], []

for wi, vi in wv:
    if wi==w1:
        l1.append(vi)
    elif wi==w1+1:
        l2.append(vi)
    elif wi==w1+2:
        l3.append(vi)
    else:
        l4.append(vi)

l1.sort(reverse=True)
l2.sort(reverse=True)
l3.sort(reverse=True)
l4.sort(reverse=True)

l1_acc = [0]
l2_acc = [0]
l3_acc = [0]
l4_acc = [0]

for l1_i in l1:
    l1_acc.append(l1_acc[-1]+l1_i)

for l2_i in l2:
    l2_acc.append(l2_acc[-1]+l2_i)

for l3_i in l3:
    l3_acc.append(l3_acc[-1]+l3_i)

for l4_i in l4:
    l4_acc.append(l4_acc[-1]+l4_i)

ans = 0

for i in range(len(l1)+1):
    for j in range(len(l2)+1):
        for k in range(len(l3)+1):
            for l in range(len(l4)+1):
                if w1*i+(w1+1)*j+(w1+2)*k+(w1+3)*l<=W:
                    ans = max(ans, l1_acc[i]+l2_acc[j]+l3_acc[k]+l4_acc[l])
    
print(ans)

# Optimized solution
N, W = list(map(int, input().split()))
L = [[] for _ in range(4)]
wv = [tuple(map(int, input().split())) for _ in range(N)]
w0 = wv[0][0]

for w, v in wv:
    L[w-w0].append(v)

for i in range(4):
    L[i].sort(reverse=True)

acc = [[0] for _ in range(4)]

for i in range(4):
    for j in range(len(L[i])):
        acc[i].append(acc[i][-1]+L[i][j])

ans = 0

for i in range(len(L[0])+1):
    for j in range(len(L[1])+1):
        for k in range(len(L[2])+1):
            for l in range(len(L[3])+1):
                if w0*i+(w0+1)*j+(w0+2)*k+(w0+3)*l<=W:
                    ans = max(ans, acc[0][i]+acc[1][j]+acc[2][k]+acc[3][l])

print(ans)