Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N, A, B = map(int, input().split())
A = list(map(int, input().split()))
D = [int(input()) for _ in range(N)]
"""

import numpy as np

N = int(input())
arr = np.arange(1, N + 1)
t_arr = np.append(arr[1:], arr[0])

mod_arr = arr % t_arr
print(sum(mod_arr))


# def main():


# if __name__ == '__main__':
#     main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1


# def gen_counter(stop=10):
#     index = 1
#     while True:
#         if stop < index:
#             break
#         yield index
#         index += 1


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


# arr = np.arange(1, N + 1)
# t_arr = np.append(arr[1:], arr[0])
# print(sum(arr % t_arr))
n = int(input())
ss = []
for i in range(n):
    ss.append(input())

m = int(input())
ts = []
for i in range(m):
    ts.append(input())

counter = dict()

for s in ss:
    counter.setdefault(s, 0)
    c = counter.get(s)
    counter[s] = c + 1
    
for t in ts:
    counter.setdefault(t, 0)
    c = counter.get(t)
    counter[t] =  c - 1
    
ans = max(counter.values()
if ans < 0:
    ans = 0
print(ans)


    


### FIXED CODE ###

n = int(input())
ss = []
for i in range(n):
    ss.append(input())

m = int(input())
ts = []
for i in range(m):
    ts.append(input())

counter = dict()

for s in ss:
    counter.setdefault(s, 0)
    c = counter.get(s)
    counter[s] = c + 1
    
for t in ts:
    counter.setdefault(t, 0)
    c = counter.get(t)
    counter[t] =  c - 1
    
ans = max(counter.values())
if ans < 0:
    ans = 0
print(ans)
N, T = list(map(int, input().split()))
A = list(map(int, input().split()))

benefit = -1
cost = 1

for i in range(N - 1):
    for j in range(i + 1, N):
        if benefit == A[j] - A[i]:
            cost += 1
        if benefit < A[j] - A[i]:
            cost = 1
            benefit = A[j] - A[i]

print(cost)

### FIXED CODE ###

L = list(map(int, input().split()))
max_index = L.index(max(L))

X = 0
S = 0

for i in range(3):
    if i == max_index:
        X = L[i]
    else:
        S += L[i]

if X == S:
    print("Yes")
else:
    print("No")
a=input()
b=input()
c=input()
d=input()

x=int(a)*int(b)
y=int(c)*int(d)

if x>y:
    print(x)

elif x<y:
    print(y)

else:
    print(x)

### FIXED CODE ###

a,b,c,d=input().split()

x=int(a)*int(b)
y=int(c)*int(d)

if x>y:
    print(x)

elif x<y:
    print(y)

else:
    print(x)
n, k = [int(i) for i in input().split()]
s = [0,1] + [int(i) for i in list(input())] + [1,0]
down = [i for i in range(n+3) if s[i] == 1 and s[i+1] == 0]
up = [i for i in range(n+3) if s[i] == 0 and s[i+1] == 1]
#print(s)
#print(down)
#print(up)
if k >= len(up):
  ans = n
else:
  if down[k] - up[0] - 1 > ans:
    ans = down[k] - up[0] - 1
  for i in range(1,len(up)-k-1):
    if down[i + k] - up[i] > ans:
      ans = down[i + k] - up[i]
  if down[len(up)-1] - up[len(up)-k -1] - 1 > ans:
    ans = down[len(up)-1] - up[len(up)-k -1] - 1
print(ans)

### FIXED CODE ###

n, k = [int(i) for i in input().split()]
s = [0,1] + [int(i) for i in list(input())] + [1,0]
down = [i for i in range(n+3) if s[i] == 1 and s[i+1] == 0]
up = [i for i in range(n+3) if s[i] == 0 and s[i+1] == 1]
#print(s)
#print(down)
#print(up)
ans = 1
if k >= len(up):
  ans = n
else:
  if down[k] - up[0] - 1 > ans:
    ans = down[k] - up[0] - 1
  for i in range(1,len(up)-k-1):
    if down[i + k] - up[i] > ans:
      ans = down[i + k] - up[i]
  if down[len(up)-1] - up[len(up)-k -1] - 1 > ans:
    ans = down[len(up)-1] - up[len(up)-k -1] - 1
print(ans)
# coding:utf-8
import math

x1,y1,x2,y2=list(map(int,input().split()))

print(math.sqrt((x2-x1)**2+(y2-y1)**2))

### FIXED CODE ###

# coding:utf-8
import math

x1,y1,x2,y2=list(map(float,input().split()))

print(math.sqrt((x2-x1)**2+(y2-y1)**2))
n, m, x, y = map(int, input().split())
x_max = max(list(map(int, input().split())))
y_min = min(list(map(int, input().split())))

if x_max < y and x_max < y_min:
  print('No War')
else:
  print('War)

### FIXED CODE ###

n, m, x, y = map(int, input().split())
x_max = max(list(map(int, input().split()))+[x])
y_min = min(list(map(int, input().split()))+[y])

if x_max < y_min:
  print('No War')
else:
  print('War')
n=int(input())
a=[]
for i in range(n):
  aa=input()
  if aa in a or aa[0] != a[-1][0]:
    print("No")
    break
  if i == n-1:
    print("Yes")
  a.append(aa)

### FIXED CODE ###

n=int(input())
a=[input()]
for i in range(n-1):
  aa=input()
  if aa in a or aa[0] != a[-1][-1]:
    print("No")
    break
  if i == n-2:
    print("Yes")
  a.append(aa)
a,b,t=map(int,input().split())
i=1
while i*a<t+0.5:
  i++
print{(i-1)*b}


### FIXED CODE ###

a,b,t=map(int,input().split())
i=1
while i*a<t+0.5:
  i+=1
print((i-1)*b)
n = int(input())
s = input()
if n % 2 !=0:
  print('No')
  sys.exit()
b = int(n/2)
if s[0:b]==s[b:n]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import sys
n = int(input())
s = input()
if n % 2 !=0:
  print('No')
  sys.exit()
b = int(n/2)
if s[0:b]==s[b:n]:
  print('Yes')
else:
  print('No')
s = input()
if s[0] == s[1] == s[2] == s[3]:
  print('No')
  break
if s[0] == s[1]:
  if s[2] == s[3]:
    print('Yes')
  else:
    print('No')
elif s[0] == s[2]:
  if s[1] == s[3]:
    print('Yes')
  else:
    print('No')
elif s[0] == s[3]:
  if s[1] == s[2]:
    print('Yes')
  else:
    print('No')
else:
  print('No')


### FIXED CODE ###

s = input()
if s[0] == s[1] == s[2] == s[3]:
  print('No')
else:
  if s[0] == s[1]:
    if s[2] == s[3]:
      print('Yes')
    else:
      print('No')
  elif s[0] == s[2]:
    if s[1] == s[3]:
      print('Yes')
    else:
      print('No')
  elif s[0] == s[3]:
    if s[1] == s[2]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
n, k = list(map(int, input().split()))
ans = 0
while True:
    n = n // k
    ans += 1
        if  == 0:
            break
print(ans)

        

### FIXED CODE ###

n, k = list(map(int, input().split()))
ans = 0
while True:
    n = n // k
    ans += 1
    if n == 0:
        break
print(ans)
s = input()
print(int(s.count("1"))

### FIXED CODE ###

S = input()
li = list(S)
 
ans = 0
for i in range(3):
  if li[i] == "1":
    ans += 1
print(ans)
import math

N = int(input())
I = int(math.sqrt(N) // 1)
print(I)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    k = len(list(str(i)))
    l = len(list(str(j)))
    m = max(k, l)
    a.append(m)
print(min(a))

### FIXED CODE ###

N = int(input())
l = []
for a in range(1, 10**5+1):
  if N % a == 0:
    b = N // a
    s = max(len(str(a)), len(str(b)))
    l.append(int(s))
print(min(l))
import math as m

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

z = a ** 2 * b

if z / 2 >= x:
  ap = x * 2 / a / b
  at = m.degrees(m.atan(b/ap))
  print(at)
else:
  bp = b - x / (a ** 2)
  bt =　m.degrees(m.atan(bp*2/a))
  print(bt)

### FIXED CODE ###

import math as m

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

z = a ** 2 * b

if z / 2 >= x:
  ap = x * 2 / a / b
  at = m.degrees(m.atan(b/ap))
  print(at)
else:
  bp = b - x / (a ** 2)
  bt = m.degrees(m.atan(bp*2/a))
  print(bt)
#coding: utf-8
import sys

N = int(sys.stdin)
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

### FIXED CODE ###

#coding: utf-8

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)
s=input()
l=len(s)
ans=0
for i in range(0,l-3):
    for j in range(i+3,l):
        test=int(s[i:j+1])
        if test%2019==0:
            ans+=1
print(ans)

### FIXED CODE ###

s,w=map(int,input().split())
if w>=s:
    print("unsafe")
else:
    print("safe")
n,m=map(int,input().split())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(m):
 a,b=map(int,input().split())
 g[a].append(b)
 g[b].append(a)
ans=0
for v in range(1,n+1):
 for u in g[v]: #i番目の展望台から1本の道を通っていけるすべての展望台と高さを比較する
   if arr[u]>=arr[v]:
     break
 else: #i番目の展望台の高さが他のすべての展望台の高さより真に大きければ答えを1増やす
   ans+=1
print(ans)

### FIXED CODE ###

S = input()

if S == 'ABC':
    print('ARC')
else:
    print('ABC')
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cum_a = []
total = 0
for i in range(n):
  total += a[i]
  if total > k:
    break
  cum_a.append(total)
  
cum_b = []
total = 0
for j in range(m):
  total += b[j]
  if total > k:
    break
  cum_b.append(total)
lim_a = len(cum_a)
lim_b = len(cum_b)
idx = 0
ans = lim_a
for l in range(1, lim_a + 1):
  while True:
    if k >= cum_a[-l] + cum_b[idx]:
      ans = lim_a - l + idx + 2
    else:
      idx += 1
    idx += 1
print(ans)


### FIXED CODE ###

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cum_a = []
total = 0
for i in range(n):
  total += a[i]
  if total > k:
    break
  cum_a.append(total)
  
cum_b = []
total = 0
for j in range(m):
  total += b[j]
  if total > k:
    break
  cum_b.append(total)
lim_a = len(cum_a)
lim_b = len(cum_b)
idx = 0
ans = lim_a
for l in range(1, lim_a + 1):
  while idx < lim_b:
    if k >= cum_a[-l] + cum_b[idx]:
      ans = max(ans, lim_a - l + idx + 2)
    else:
      break
    idx += 1
ans = max(ans, lim_b)
print(ans)
def solve():
    import sys
    file_input = sys.stdin
    
    def tetra_num(n):
        for i in range(1, 181):
            t = i * (i + 1) * (i + 2) // 6
            if t <= n:
                yield t
            else:
                break
    
    while True:
        n = int(file_input.readline())
        if n == 0:
            break
        
        n_lim = 1000000
        rec = [n_lim] * (n + 1)
        rec[0] = 0
        odd_rec = [n_lim] * (n + 1)
        odd_rec[0] = 0
        
        for t in tetra_num(n):
            if t % 2 == 0:
                for i, tpl in enumerate(zip(rec[t:], rec), start=t):
                    a, b = tpl
                    rec[i] = min(a, b + 1)
            else:
                z_rec = zip(rec[t:], rec, odd_rec[t:], odd_rec)
                for i, tpl in enumerate(z_rec, start=t):
                    a, b, c, d = tpl
                    rec[i] = min(a, b + 1)
                    odd_rec[i] = min(c, d + 1)
                    
        print(rec[n], odd_rec[n])

solve()


### FIXED CODE ###

def solve():
    rec = [1000000] * 1000000
    rec[0] = 0
    odd_rec = rec.copy()
    
    for i in range(1, 181):
        t = i * (i + 1) * (i + 2) // 6
        for i, tpl in enumerate(zip(rec[t:t*3+1], rec), start=t):
            a, b = tpl
            b += 1
            if b < a:
                rec[i] = b
        if t % 2:
            for i, tpl in enumerate(zip(odd_rec[t:t*34+1], odd_rec), start=t):
                a, b = tpl
                b += 1
                if b < a:
                    odd_rec[i] = b
    
    import sys
    file_input = sys.stdin
    n = int(file_input.readline())
    while n:
        print(rec[n], odd_rec[n])
        n = int(file_input.readline())

solve()
x,y = map(int, input().split())

while True:

    if x == 0 and y == 0:
        break

    elif x => y:
        print(str(x) + " " + str(y))

    else:
        print(str(y) + " " + str(x))



### FIXED CODE ###

while True:
    x,y = map(int, input().split())

    if x == 0 and y == 0:
        break

    elif x <= y:
        print(str(x) + " " + str(y))
    else:
        print(str(y) + " " + str(x))
a,b,c = map(int,input().split())
a,b,c = map(int,input().split())
l=sorted([a,b,c])
print(l[2]-l[1]+l[1]-l[0])


### FIXED CODE ###

a,b,c = map(int,input().split())
l=sorted([a,b,c])
print(l[2]-l[1]+l[1]-l[0])
import numpy as np

def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [1, 2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

def get_gcd(a, b):
    if b > a:
        a, b = b, a
    r = a%b
    if r == 0:
        return b
    else:
        return get_gcd(b, r)

A, B = map(int, input().split())
gcd = get_gcd(A, B)
primes = get_sieve_of_eratosthenes(gcd)
divisors = [p for p in primes if gcd%p==0]
print(len(divisors))

### FIXED CODE ###

def get_gcd(a, b):
    if b > a:
        a, b = b, a
    r = a%b
    if r == 0:
        return b
    else:
        return get_gcd(b, r)


def prime_factorize(n):
    answers = []
    while n % 2 == 0:
        answers.append(2)
        n //= 2
    f = 3
    while f**2 <= n:  # instead of f <= n**0.5
        if n % f == 0:
            answers.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        answers.append(n)
    return answers

A, B = map(int, input().split())
gcd = get_gcd(A, B)
factors = prime_factorize(gcd)
print(len(set(factors+[1])))
n = int(input())
ans = 0
for i in range(n):
  x,y = input().split()
  ans += (int(x) if y == "JPY" else int(x)*48000)
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(n):
  x,y = input().split()
  ans += (float(x) if y == "JPY" else float(x)*380000)
print(ans)
from collections import deque

n, k = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))

loop = []
visited = set()
s = set([1])
seq_s = [1]
loop_creating = False
last = 1

while True:
  if loop_creating and len(visited) == 0:
    break

  nex = a[last - 1]

  if nex in visited:
    visited.remove(nex)
    loop.append(nex)
    loop_creating = True
  elif nex in s:
    visited.add(nex)
  else:
    s.add(nex)
    seq_s.append(nex)

  last = nex

if k <= len(s):
  print(seq_s[k])
elif k > len(s):
  rem = k - len(s)
  print(loop[rem % len(loop)])

### FIXED CODE ###

from collections import deque

n, k = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))

loop = []
visited = set()
s = set([1])
loop_creating = False
last = 1

while True:
  if loop_creating and len(visited) == 0:
    break
  
  if k == len(s) - 1:
    print(last)
    exit(0)

  nex = a[last - 1]

  if nex in visited:
    visited.remove(nex)
    loop.append(nex)
    loop_creating = True
  elif nex in s:
    visited.add(nex)
  else:
    s.add(nex)

  last = nex

rem = k - len(s)
print(loop[rem % len(loop)])
import sys
from sys import stdin
input = stdin.readline
N=int(input())
edges=[list(map(int,input().split())) for i in range(N)]
for k in range(N):
  for i in range(N):
    for j in range(i):
      if edges[i][j]>edges[i][k]+edges[k][j]:
        print(-1)
        sys.exit()
 
ans=0
for i in range(N):
  for j in range(i):
    need=1
    for k in range(N):
      if k!=i and k!=j and A[i][j]==A[i][k]+A[k][j]:
        need=0
        break
    if need:ans+=A[i][j]
print(ans)

### FIXED CODE ###

def Warshall_Floyd(edges,N):
  """頂点N個のグラフ上の隣接行列edges(空欄はinfとせよ)が与えられたとき, 
  2点間の最短距離距離を隣接行列で返す"""
  for k, i, j in itertools.product(range(N), range(N),range(N)):
    if edges[i][j]>edges[i][k]+edges[k][j]: return 1
  return 0
 
import sys
import itertools
N=int(input())
A=[list(map(int,input().split())) for i in range(N)]
if Warshall_Floyd(A,N):
  print(-1)
  sys.exit()
 
ans=0
for i, j in itertools.product(range(N),range(N)):
  need=1
  for k in range(N):
    if k!=i and k!=j and A[i][j]==A[i][k]+A[k][j]:
      need=0
      break
  if need:ans+=A[i][j]
print(ans//2)
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[1])
XY.sort(key=lambda x: x[0])

PQ = {}
for i in range(1, len(XY)):
    pq = XY[i][0] - XY[i-1][0], XY[i][1] - XY[i-1][1]
    if pq in PQ.keys():
        PQ[pq] += 1
    else:
        PQ[pq] = 1
pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])


### FIXED CODE ###

import sys

N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])
XY.sort(key=lambda x: x[1])

if N == 1:
    print(1)
    sys.exit()

PQ = {}
for i in range(len(XY)):
    for j in range(len(XY)):
        pq = XY[i][0] - XY[j][0], XY[i][1] - XY[j][1]
        if pq == (0, 0):
            continue
        if pq in PQ.keys():
            PQ[pq] += 1
        else:
            PQ[pq] = 1

pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])
S=str(input())
formula=[""]*(len(S)*2-1)
ans=0
for i in range(len(S)*2-1):
    if i%2==0:
        formula[i]=S[i//2]
place=pow(2,len(S)-1)-1
for i in range(place+1):
    for j in range(len(bin(i))-2):
        #strしたbinには0bのprefixが付く。
        if int(str(bin(i))[-j-1])==1:
            formula[2*j+1]="+"
    ans+=eval(''.join(formula))
    for k in range(len(bin(i))-2):
        formula[2*k+1]=""
print(ans)

### FIXED CODE ###

S=str(input())
formula=[""]*(len(S)*2-1)
ans=0
for i in range(len(S)*2-1):
    if i%2==0:
        formula[i]=S[i//2]
place=pow(2,len(S)-1)-1
for i in range(place+1):
    for j in range(len(bin(i))-2):
        #strしたbinには0bのprefixが付く。
        if int(str(bin(i))[-j-1])==1:
            formula[2*j+1]="+"
    ans+=eval(''.join(formula))
    for k in range((len(formula)-1)//2):
        formula[2*k+1]=""
print(ans)
N = list(int(input()))
if N.count(0) == len(N) - 1:
  print(10)
else:
  sum(N)


### FIXED CODE ###

N = list(input())
list1 = [int(x) for x in N]
if N.count("0") == len(N) - 1 and N[0] == "1" and len(N) != 1:
  print(10)
else:
  print(sum(list1))
dic={}
a=[[0 for i in range(3)]for j in range(3)]
for i in range(1,100):
    dic[i]=[-1,-1]
for i in range(3):
    for j in range(3):
        x=int(input())
        a[i][j]=3
        dic[x]=[i,j]
n=int(input())
for i in range(n):
    x=int(input())
    if(dic[x]!=[-1,-1]):
        a[dic[x][0],dic[x][1]]=0
flag=0
for i in range(3):
    if(max(a[i][1],a[i][2],a[i][0])==0):
        flag=1
        break
    elif(max(a[1][i],a[2][i],a[3][i])==0):
        flag=1
        break
if(max(a[0][0],a[1][1],a[2][2])==0):
    flag=1
elif(max(a[0][2],a[1][1],a[2][0])==0):
    flag=1
if(flag==1):
    print ('Yes')
else:
    print ('No')

### FIXED CODE ###

dic={}
a=[]
for i in range(1,100):
    dic[i]=[-1,-1]
for i in range(3):
    a.append(list(map(int,input().split())))
    for j in range(3):
        dic[a[i][j]]=[i,j]
n=int(input())
for i in range(n):
    x=int(input())
    if(dic[x]!=[-1,-1]):
        a[dic[x][0]][dic[x][1]]=0
flag=0
for i in range(3):
    if(max(a[i][1],a[i][2],a[i][0])==0):
        flag=1
        break
    elif(max(a[1][i],a[2][i],a[0][i])==0):
        flag=1
        break
if(max(a[0][0],a[1][1],a[2][2])==0):
    flag=1
elif(max(a[0][2],a[1][1],a[2][0])==0):
    flag=1
if(flag==1):
    print ('Yes')
else:
    print ('No')
a,b=int(input().split())
print(max(a+b,a-b,a*b))

### FIXED CODE ###

a,b=map(int,input().split())
print(max(a+b,a-b,a*b))
import bisect
N, M = map(int, input().split())
a = []
number = []
flag = 0
for i in range(M):
    A, B = map(int, input().split())
    a.append([A, B])
    a.append([B, A])
    number.append(A)
    number.append(B)
a.sort()
b = a[:]
b.reverse()
one = []
two = []
for i in range(M):
    if a[i][0] == 1:
        one.append(a[i][1])
    else:
        break

for i in range(M):
    if b[i][0] == N:
        two.append(b[i][1])
    else:
        break

if len(intersect_list(one, two)) != 0:
    print("POSSIBLE")

else:
    print("IMPOSSIBLE")


### FIXED CODE ###

import sys

N, M = map(int, input().split())
ship = [[] for i in range(N+1)]

for i in range(M):
    a, b = map(int, input().split())
    ship[a].append(b)
    ship[b].append(a)

flag = 0
for i in ship[1]:
    if N in ship[i]:
        flag = 1
if flag == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
n = 1000001
k = int(input())
x = int(input())

for i in range(x-k+1, x+k-1):
    if -n < i and i < n:
        print(i)

### FIXED CODE ###

n = 1000001
k, x = map(int, input().split())

for i in range(x-k+1, x+k):
    if -n < i and i < n:
        print(i, end=' ')
n, r = map(int, input.split())
if n >= 10:
  print(r)
else:
  print(r+100*(10-n))

### FIXED CODE ###

n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r+100*(10-n))
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return tuple(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, XY):
    c = Counter()
    for i in range(N):
        x, y = XY[i]
        for j in range(N):
            if i == j:
                continue
            a, b = XY[j]
            c[(x-a, y-b)] += 1

    return N - c.most_common(1)[0][1]


def main():
    N = read_int()
    XY = [read_int_n() for _ in range(N)]
    print(slv(N, XY))


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return tuple(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, XY):
    c = defaultdict(list)
    for i in range(N):
        x, y = XY[i]
        for j in range(N):
            if i == j:
                continue
            a, b = XY[j]
            c[(x-a, y-b)].append((i, j))

    ans = 0
    for _, v in c.items():
        l = set()
        r = set()

        for x, y in v:
            l.add(x)
            r.add(y)

        g = (len(l) - len(l & r))
        ans = max(ans, len(l | r) - g)
        # print(v, len(l | r), g, l & r)
    return N - ans


def main():
    N = read_int()
    XY = [read_int_n() for _ in range(N)]
    print(slv(N, XY))


if __name__ == '__main__':
    main()
A, B = map(int, input().split())

print(min(A*N, B))

### FIXED CODE ###

N, A, B = map(int, input().split())
 
print(min(A*N, B))
x = int(input())
a = int(input())
if x < a :
    print(0)
else :
    print(10)

### FIXED CODE ###

x,a = map(int, input().split())
if x < a :
    print(0)
else:
    print(10)