peterverebics/CodeNet_Python_118 huggingface dataset:
a, b = map(int, input().split())
cnt = 0
power = 0

while(power < b):
    cnt += 1
    power += a

print(cnt)
a,b=input().split()
a=int(a)
b=int(b)
i=0
sum=0
while True:
    if i==0:
        b=b-a
        sum+=1
        i+=1
    elif b<=0:
        print(sum)
        break
    else:
        b=b-a+1
        sum+=1
        i+=1
import math
A,B  = list(map(int,input().split()))
ans  = A
c = 1
while ans < B:
    ans += A
    ans -= 1
    c += 1
print(c)
# coding: utf-8
 
a,b=list(map(int,input().split()))
 
mouse_tot = a
mouse_cnt = 1
add_mouse = a-1
 
while mouse_tot <  b:
    mouse_tot += add_mouse
    mouse_cnt += 1
 
if b==0:
    mouse_cnt = 0
 
print(mouse_cnt)
import math
a, b = map(int, input().split())
print(math.ceil((b-a)/(a-1))+1 if a<b else 1)
[A,B] = list(map(int,input().split()))

amari = B % A
if amari==0:
    print(B//A)
else:
    print(B//A +1)
a, b = list(map(int, input().split()))
count = 0
ans = 0


if count == 0:
    count += a
    ans += 1

while True:
    if count < b:
        count += a-1
        ans += 1
    else:
        break

print(ans)
a,b = map(int,input().split())
ans=b//a + 1
if b%a != 0:
	print(ans)
else:
	print(1)
A, B = map(int, input().split())


cn = 0
C = 0

if A == B:
    print(1)
    exit()
elif A > B:
    print(0)
    exit()
for i in range(100):
    if i == 0:
        C = C + A
        cn = cn + 1
    else:
        C = C + A - 1
        cn = cn + 1
        if C >= B:
            print(cn)
            break
A,B = map(int,input().split())

result = 0
cnt = 1
for i in range(B):
    if(B - result < A):
        result +=A
        #cnt += 1
        break
    else:
        cnt += 1
        result += A-1

print(cnt)
p = list(map(int,input().split()))
min_tap = p[1] % p[0]
if min_tap == 0:
    count = int(p[1] / p[0])
else:
    count = p[1] // p[0] + 1
print(count)
a, b = map(int, input().split())
c = b//a
if b == 1:
    print(0)
else:
    if b % a == 0:
        print(c)
    else:
        print(c+1)
a,b=map(int,input().split())
print((b-1)//a+1)
A, B = map(int, input().split())

N = 1
sum = A

while (sum < B):
     N += 1
     sum = A * N

     if sum >= B:
         break

ans = N

print(ans)
a,b=map(int,input().split())
print((a+b-1)//a)
import math
a, b = map(int, input().split())
print(math.ceil(b-1)//(a-1))
a,b = map(int,input().split())
i = 0

while True:
    if a*i >= b:
        break
    else:
        i += 1

print(i)
import math

A, B = map(int, input().split())

if B == 1:
    print(0)
else:
    if (math.ceil(B/A)-1) * (A-1) + A < B:
        print(math.ceil(B/A)+1)
    else:
        print(math.ceil(B/A))
a, b = map(int, input().split())
c = 1
while True:
  if a >= b:
    break
  elif c == 1:
    a -= 1
    c += 1
    a += a+1
    continue
  c += 1
  a += a+1
print(c)
A, B =map(int,input().split())
count = 0
N = 1

if A != B:
    while count < B:
        if A < B:
            N += 1
        if A*N > B:
            print(N)
            break
else :
    #print("no")
    print(1)
a, b = map(int, input().split())

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

if a >= b:
  print(1)
else:
  b -= a
  print(1 + b//(a-1))
a, b= map(int, input().split())
x = a
y = 1
while x < b:
    y += 1
    x = y*(a-1)
print(y)
a, b = map(int, input().split())
 
tap_num = 0
con_num = a + (a * tap_num -1)
 
# con_num > b となることが必要条件
# a + (a * tap_num -2) < b < a + (a * tap_num -1)
 
for tap_num in range(b):
    if a + (a * tap_num -1) > b:
        break
    
print(tap_num)
A,B = map(int, input().split())
if B==1:
  print(0)
elif B<A:
  print(1)
else:
  print(B//(A-1))
a,b = map(int,input().split())
print(int(-(-a//b)))
A,B = map(int,input().split())
if B == 1:
	print(0)
elif B % A == 0:
	print(B//A)
else:
	print((B+A)//A)
A,B=map(int,input().split())
if B==1:
  n=0
elif B%A==0 and B//A==1:
  n=1
else:
  n=B//A+1
print(n)
a,b=map(int,input().split())
count=0
for i in range(1,21):
  if a*i-count>=b:
    break
  else:
    count+=1
if a>=b:
  i=1
print(i)
a,b=map(int,input().split())
ct=1
ans=a
while ans<b:
    ct+=1
    ans=(a*ct)-(ct-1)
print(ct)
A,B = map(int,input().split())
flag = A
ans = 0
while flag < B:
  flag += A - 1
  ans += 1
  
print(ans + 1)
a, b = map(int, input().split())
ans = 1
while True:
  if ans * a - (ans-1) >= b:
    break
  ans += 1
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    A, B = LI()

    ans = (B - 1) // A + 1
    print(ans)

if __name__ == '__main__':
    resolve()
def solve():
  a, b = map(int, input().split())
  if b <= 1:
    print(0)
  elif a >= b:
    print(1)
  else:
    print(b//(a-1)+1)
  return 0
 
if __name__ == "__main__":
  solve()
A, B = map(int, input().split())

sumu = 0
count = 0
for i in range(A):
    if i==0:
        sumu += A
        count += 1
    else:
        sumu += A-1
        count += 1
    if sumu >= B:
        break

print(count)
A, B = map(int, input().split())

count = 0
tap = 1

while tap < B:
    tap += A
    count += 1
print(count)
a, b = map(int, input().split())
for i in range(b):
    if (a-1)*i + a >= b:
        print(i+1)
        break
import sys
import math
a,b= map(int,input().split())
#N=int(input())
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
i=0
c=b-a
if c%a==0:
  print((c//a)+1)
else:
  print((c//a)+2)
a, b = map(int, input().split())
for i in range(b):
    if  a * i == b:
        print(i)
        exit()
a, b = map(int, input().split())

i = 1
while(True):
    if a * i - (i - 1) >= b:
        print(i)
        break
    i+=1
a, b = map(int, input().split())
print((b+a-1)//a)
A, B = map(int, input().split())
if A//B == 0:
  print(A//B * A)
else:
  print(A//B * A + 1)
A,B = map(int, input().split())
print(1+B//(A-1))
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    a, b = map(int, input().split())
    ans = 1
    sockets = a
    while sockets < b:
        sockets += (a - 1)
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()
a,b=map(int,input().split())
if a-1 >= b:
  print('1')
  
else:
  c= (b-a)//(a-1)+1
  print(str(c))
a, b = map(int, input().split())

for i in range(100):
    if a * i >= b:
        print(i)
        break
import math
a, b = map(int,input().split())
print(math.ceil(b-1/a-1))
import sys
a, b = map(int, input().split())
ans = 0

for i in range(10):
  if a * i >= b:
    ans = i
    print(ans)
    sys.exit()
a,b=map(int,input().split())
num=1
hoge=a
while b>hoge:
  hoge+=a
  num+=1

print(num)
a,b=map(int,input().split())
if a>=b:
    print(1)
else:
    for i in range(1,20):
        if (a-1)*i+a>=b:
            print(i+1)
            exit()
    print(i+1)
a,b = list(map(int,input().split()))

for i in range(2,10**9):
    if (a-1) * i + 1 >= b:
        print(i)
        break
import math

A,B = map(int,input().split())
print(math.ceil((B+1)/(A+1)))
a, b = map(int, input().strip().split())

outlet = 1
taps = 0
while outlet < b:
    taps += 1
    outlet += a - 1
a,b=map(int,input().split())
import math
ans=math.floor((b-1)/(a-1))
print(ans)
a,b= map(int,input().split())
count = a
ko = 1
while b > count:
    count += a-1
    ko += 1
print(ko)
x = input().split()

a = int(x[0])
b = int(x[1])

c = 1
outlet = a

while True:
  if(outlet >= b):
    print(c)
    break
  elif(outlet < b):
    c = c + 1
    outlet = outlet + a - 1
A,B=map(int,input().split())
if B>=A :
    print((B-1)//(A-1))

else : 
    print(1)
A,B=[int(x) for x in input().rstrip().split()]

if B%A==0:
  print(B//A)
else:
  print(B//A+1)
import math
def main():
    A, B = map(int, input().split())
    if A > B:
        print(1)
    else:
        print(math.ceil(B/A))
main()
#190901B
A, B = map(int, input().split())
ans=0
if B%A==0:
    ans = B//A
else:
    ans = B//A + 1
print(ans)
from math import ceil
a,b=map(int,input().split())
print(ceil(max((b-a),0)/(a-1))+1)
a,b = map(int, input().split())

ba = b%a
if ba == 0:
    print(b//a)
else:
    print((b//a)+1)
a,b=map(int,input().split())

cnt=0
aa=1
while b>aa:
    if cnt==0:
        cnt+=1
        aa+=a
    else:
        cnt+=1
        aa=(aa-1)+a

print(cnt)
import sys
sys.setrecursionlimit(10**6)
A,B = map(int,input().split())
flag = 1
result = 1
cnt = 1
if A >= B:
    print(1)
    exit()

while True:
    if ((A - 1) * cnt + A) >= B:
        break
    else:
        cnt += 1
print(cnt + 1)
# 139 B

a, b = map(int, input().split())

if b <= a:
    print(1)
else:
    if b % a == 0:
        print(b // a)
    else:
        print((b // a) + 1)
A,B = [int(hoge) for hoge in input().split()]
print((B-1)//(A-1))
A, B = map(int, input().split())
i = 0

if A > B :
    print(1)
else:
    while (A-1) * i + 1 < B:
        i += 1
    print((A-1) * i + 1)
a,b=[int(x) for x in input().split()]
 
c=1
ans=0
while True:
  if c>=b:
    break
  else:
    c+=a
    ans+=1
import math
a, b = map(int,input().split())
print(math.ceil(b/a))
a, b = map(int, input().split())
result = a
cnt = 1
 
for _ in range(20):
    if result >= b:
        break
    result += a-1
    cnt += 1
print(cnt)
A, B = map(int, input().split())


cn = 0
C = 0

if A == B:
    print(1)
    exit()
for i in range(100):
    if i == 0:
        C = A
        cn = cn + 1
    else:
        C = C + A - 1
        cn = cn + 1
        if C >= B:
            print(cn)
            break
# https://atcoder.jp/contests/abc139/tasks/abc139_b
a, b = map(int, input().split())

ans = 0
ad = 0
while ad < b:
    ad += a
    ans += 1
print(ans)
A,B= map(int, input().split())
now_sum = A
ans = 1
while True:
     if now_sum >= B:
         print(ans)
         break
     now_sum += A-1
     ans += 1
A, B = map(int, input().split())
ans = (B - 1) // A
if (B-1)%A > 0:
  ans +=1
print(ans)
import sys
A,B = map(int,input().split())
for i in range(1,100):
  if (1+(A-1)*i) >= B:
    print(i)
    sys.exit()
a,b=input().split()
a=int(a)
b=int(b)
if a>=b:
  print(1)
else:
  if b%(a-1)==0:
    print(int(b/(a-1))+2)
  else:
    print(int(b/(a-1)))
a,b = map(int,input().split())
f = 0
som = 0
cnt = 0
while(som < b and f == 0):
    som = som+a
    if som < b:
        som = som-1
        cnt = cnt+1

print(cnt+1)
# https://atcoder.jp/contests/abc139/tasks/abc139_b
a, b = map(int, input().split())

if b % a == 0:
    ans = b // a
else:
    ans = b // a + 1
print(ans)
a,b = [int(x) for x in input().split()]
print((b + a)//(a+1))
[A,B] = list(map(int,input().split()))

s=5
i=1
while True:
    if B==1:
        print(0)
        break
    elif A==B:
        print(1)
        break

    elif s>=B:
        print(i)
        break
    s+=4
    i+=1
import math
a, b = [int(w) for w in input().split()]

print(math.ceil((b - 1) / a))
A,B = map(int,input().split())
ans = 1
import copy
C = copy.copy(A)
while A<B:
    A += C-1
    ans +=1
print(ans)
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    A, B = map(int, input().split())

    result = 0
    count = 1
    while result < B:
        count += (A - 1)
        result += 1
    print(result)


if __name__ == "__main__":
    main()
def invr():
    return(map(int, input().split()))


a, b = invr()
res = int(b/a)
if b % a != 0:
    res += 1
print(res)
a,b = map(int,input().split()) 
if a>=b:
  print(1)
else:
  print((b-a)//(a-1)+1)
a, b= map(int, input().split())
if a == b:
    print(1)
    exit()
print(b//a+1)
import itertools
import math
import fractions
import functools
a, b = map(int, input().split())

if a - b > 0:
    print(0)
    quit()

n = 1
while a*n-(n-1) < b:
    n += 1

print(n)
a, b = map(int, input().split())
c = (b-1)//a + 1
if b == 1:
	print(0)
else:
	print(c)
a,b = map(int,input().split())
cnt = 0; tap = 0
while True:
    cnt += 1
    if a == b:
        break
    tap += (a-1)
    if tap + a >= b:
        cnt += 1
        break
print(cnt)
A, B = list(map(int, input().split()))

ans = 0
outlet = 1

while outlet < B:
    outlet += A
    ans += 1

print(ans)
a, b = map(int,input().split())

n = int(a-1/b-1) + 1

print(n)
import math
a,b = map(int,input().split())
if a == b:
  print(int(math.log(b,a)))
else:
  print(int(math.log(b,a)) + 1)
import math
A, B = map(int, input().split())
print(math.ceil(B / A))
from math import ceil
A,B=list(map(int, input().split()))
print(ceil((B-1)//(A-1)))
import math
a,b =map(int, input().split())
print(math.floor((b-1)/(a-1)))
a,b = map(int,input().split())
i = 1
while i<500:
  if a*i - i + 1 >= b:
    break

print(i)
#!/usr/bin/env python3
import sys
import copy
from collections import deque


def main():

    a, b = map(int, input().split())
    cnt=0
    while (1):
        cnt+=1
        if a*cnt>=b:
            print(cnt)
            sys.exit(0)

main()
a, b=map(int,input().split())
if 1<=b<=a+1:
    print(1)
else:
    print(1+(b-2)//a)
a,b = map(int, input().split())
count = 1
while True:
  if b <= (a-1)*(count-1) + a:
    break
  count += 1
print(count)
def main():
    a, b = map(int, input().split())
    i = 0
    while ((a-1)*i + a) < b:
        i += 1
    print(i+1)

if __name__ == '__main__':
    main()
q_input = input()

a, b = map(int, q_input.split(' '))

ans = int((10-1+a-2)/(a-1))

print(ans)
a,b=map(int,input().split())
ans=1
while ans*(a-1)+1<b:
    ans+=1
print(ans)
# 初期入力
A,B = (int(x) for x in input().split())

#
import math
tapp_num = (B//(A-1))
sasikomiguti_misiyou=0
if B<=A:
    print(1)
else:        
    sasikomiguti_misiyou =(tapp_num -1)*(A) +A-1
    if B <= sasikomiguti_misiyou:
        print(tapp_num)
    else:
        print(tapp_num +1)
import sys
a,b = map(int, input().split())

if b == 1:
  print(0)
  sys.exit()

ans = 0
flag = True
while flag:
  ans += 1
  if b <= (ans-1)*a + a:
    flag = False

print(ans)
A, B = map(int, input().split())
K = 1
L = 0
while A*K-L < B:
    K = K+1
    L = L+1
print(K)
A, B = map(int, input().split())

K = A
ans = 1

while(K < B):
	K += (A-1)
	ans += 1
	
print(ans)
A,B=map(int,input().split())
n=0
count=0
while n<=B:
    n+=(A-1)
    count+=1
print(count)
A,B=map(int,input().split())
i=1
while True:
    if A+A*(i-1)>=B:
        break
    i+=1

print(i)
A, B = map(int, input().split())
Ans = 0
if A >= B:
    Ans = 1
else:
    Ans += 1
    temp = B - A
    if temp % (A-1) == 0:
        Ans += temp // (A-1)
    else:
        Ans += temp // (A-1) + 1
print(Ans)
a, b = map(int, input().split())
af = 1
cnt = 0
while True:
    af += (a-1)
    cnt += 1
    if af >= b:
        break
print(cnt)
A,B = map(int,input().split())
num = 1
ans = 0
while num < B:
  num += (A-1)
  ans += 1
a,b = map(int, input().split())
count = int(b/a)
if b%a != 0:
  print(count+1)
else:
  print(count)
if __name__ == '__main__':
    n = int(input())
    t = (1 + n) * n // 2
    print(t - n)
n = int(input())
ans = (n*(n-1))//2
print(ans)
N = int(input())
A = N*(N+1)//2-N
print(A)
n=int(input())

ans=0
for i in range(n):
  ans+=i
print(ans)
n =int(input())
ans = n * (n - 1) // 2
print(ans)
N=int(input())
ans=(1+(N-1))*(N-1)//2
print(ans)
N=int(input())
if N==1:print(0)
else:print((1+(N-1))*(N-1)//2)
from decimal import Decimal

n = int(input())
print(int(Decimal((n-1)/2)*Decimal(n)))
N = int(input())
ans = N*(N-1)//2
print(ans)
N = int(input())
if N == 1:
    print(0)
    exit()
ans = (1+(N-1))*(N-1)//2
print(ans)
N = int(input())

ans = N * int(N - 1)

ans = ans // 2

print(ans)
# -*- coding: utf-8 -*-
n = int(input())

su = n * (n + 1) // 2
print(su - n)
N = int(input())
ans = (N*(N-1))//2
print(ans)
s=0
for i in range(1,int(input())):
    s+=i
print(s)
n=int(input())

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

if n%2==1:
  print(((n-1)+1)*((n-1)//2))
else:
  print(((n-1)+1)*((n-1)//2)+n//2)
n=int(input())
ans=n*(n-1)//2
print(ans)
n = int(input())
tmp = (n * (n - 1))//2
print(tmp)
import sys
from itertools import permutations

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    N = int(readline())
    print(N * (N - 1) // 2)
    return


if __name__ == '__main__':
    main()
n = int(input())
print(n * (n - 1) // 2)
N = int(input())
print(N * (N - 1) // 2)
import sys
import math
import itertools
n = int(input())
if(n%2==0):
    print((n + 1) * (n // 2) - n)
else:
    print((n + 1) * ((n-1) // 2) +(n+1)//2- n)
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    ans = (N-1) * N // 2
    print(ans)
if __name__ == "__main__":
    main()
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N = int(readline())

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


if __name__ == "__main__":
    main()
n=int(input())
print((n * (n-1)) // 2 )
#!/usr/bin/env python
import sys
import re
from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor
sys.setrecursionlimit(1000000)


def main():
    input = sys.stdin.readline
    #N, M = map(int, input().split())
    #N, K = map(int, input().split())
    #ps = list(map(int, input().split()))

    N = int(input())

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


if __name__ == '__main__':
    main()
N = int(input())
if N==1:
    print(0)
else:
    print((N-1)*N//2)
N = int(input())

modsum = ((1+(N-1))*(N-1))//2

print(modsum)
n = int(input())

if n % 2 == 0:
    print(int((n+1)*(n//2)-n))
else:
    print(int(n*(n//2)))
n=int(input())
ans=(n)*(n-1)//2
print(ans)
N = int(input())
if N == 1:
    print(0)
else:
    print(N*(N-1)//2)
n = int(input())

ans = n*(n-1)//2
print(ans)
if __name__ == "__main__":
    N = int(input())

    print((N - 1) * N // 2)
def main():
    n = int(input())
    print((n - 1) * n // 2)


if __name__ == '__main__':
    main()
n = int(input()) - 1
print(n*(n+1)//2)
N=int(input())
ans=N*(N-1)//2
print(int(ans))
n = int(input())
print(n *(n - 1) // 2)
N = int(input())

ans = N * (N + 1) // 2 - N
print(ans)
n=int(input())
k=int(n*(n-1))//2
print(k)
N = int(input())
res = N * (N - 1) // 2
print(res)
n=int(input())
res=n*(n-1)//2
print(res)
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())

n = n-1

ans = (1+n)*n//2

print(ans)
# print("{:.10f}".format(ans))
N = int(input())

ans = N * (N - 1) // 2
print(ans)
n = int(input())
ans = n * (n - 1) // 2
print(ans)
n = int(input())

print((n * (n - 1))// 2)
n = int(input())

if n == 1:
    print(0)
else:
    print((n * (n-1)) // 2)
n = int(input())
ans = (n-1)*n//2
print(ans)
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
print(a*(a-1)//2)
n = int(input())

print(n * (n + 1) // 2 - n)
n = int(input())
sum = n*(n+1)//2
print(sum-n)
n = int(input())
ans = n*(n-1)//2
print(ans)
N = int(input())

print(int(N * (N - 1) // 2))
import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(input())
  ans = 0
  if N==1:
    ans = 0
  else:
    ans = (N-1) * N//2
  print(ans)
  
if __name__ == '__main__':
  main()
N = int(input())

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

print(ans)
import math
n = int(input())
if (n-1)%2 == 0:
    a = int((n-1)/2)
    ans = n*a
else:
    ans = n * math.floor((n-1)/2) + math.ceil((n-1)/2)

print(int(ans))
import sys
from collections import defaultdict
from queue import deque
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n = gete(int)
    print(n * (n - 1) // 2)


if __name__ == "__main__":
    main()
n = int(input())
t=(n-1)*n//2
print(t)
n=int(input())
ans=(n*(n-1))//2
print(ans)
n = int(input())
ans = n * (n-1) // 2
print(ans)
n = int(input())
n = n-1
print(n*(n+1)//2)
def main():
    n = int(input())
    print((n*(n+1))//2 - n)


if __name__ == '__main__':
    main()
from sys import stdin,setrecursionlimit
import string
setrecursionlimit(10 ** 7)
n = int(stdin.readline().rstrip())
print(n*(n-1)//2)
def main():
    '''
    N = aq + r (0 <= r <= a-1)よりΣrを最大にするのはr = a-1のとき
    '''
    N = int(input())
    print(N * (N - 1) // 2)


if __name__ == '__main__':
    main()
N = int(input())
ans = ((N-1)*N)//2
print(ans)
def main():
    n = int(input())
    print(n*(n-1)//2)

if __name__ == '__main__':
    main()
N = int(input())

def kaidan(k):
    return k * (k + 1) // 2

print(kaidan(N-1))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 14, 2020 11:34:55 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from sys import stdin
input = stdin.readline


def main():
  N = int(input())

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


if(__name__ == '__main__'):
  main()
N = int(input())
N -= 1
print((N*(N+1))//2)
a=int(input())
#_l=list(map(int,input().split()))

print(a*(a-1)//2)
n = int(input())
ans = (n)*(n-1)//2
print(int(ans))
N=int(input())
ans=(N-1)*N//2
print(ans)
# solution
data=int(input())
strs=(data*(data-1))//2
print(strs)
n = int(input())
"""求める最大の余りの合計は1〜N-1の合計に等しい"""
result = n*(n-1)//2
print(result)
n = int(input())
ans=(n*(n-1))//2
print(int(ans))
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


N = I()
print(N*(N-1)//2)
N = int(input())
ans = ((N)*(N-1))//2
print(ans)
N = int(input())
ans = ((1+N-1)*(N-1))//2
print(ans)
n = int(input())
print(n * (n + 1) // 2 - n)
N = int(input())

if((N-1)%2==0):
    print(N*((N-1)//2))
else:
    print(N*((N-1)//2) + N//2 )
n = int(input())

ans = n * (n // 2)
if (n - 1) % 2 == 0:
   print(ans)
else:
   print(ans - int(n / 2))
N = int(input())
n = N-1
ans = ((n+1)*n)//2
print(ans)
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
if a%2==0:
  b=a//2
  print(b*(a-1))
else:
  b=(a-1)//2
  print(a*b)
def main():
    N = int(input())
    ans = (N - 1) * N // 2
    # X % K の最大値は K-1
    # 1,2,3,...,Nで割った余りの最大値は
    # 0,1,2,...,N-1
    # 1,2,...,Nを
    # 2,3,...,N,1で割ることで
    # 余りは1,2,...,N-1,0となり、
    # 最大値を達成できる
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())
N = int(input())

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

print(ans)
import sys
from collections import deque
import itertools
from collections import deque
sys.setrecursionlimit(10 ** 9)

# map(int, sys.stdin.read().split())


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    print(N*(N-1)//2)




if __name__ == "__main__":
    main()
N = int(input())
ans = (N + 1) * (N - 2) // 2 + 1
print(ans)
n = int(input())
ans = 0
for i in range(n):
    ans += i
print(ans)
N = int(input())
if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    print((N * (N-1)) // 2)