Harryxun/stf_run huggingface dataset:
import sys
memo = {}
sys.setrecursionlimit(40320)
def swap(state, a, b):
    state[a], state[b] = state[b], state[a]
def dfs(state, pos, c):
    key = "".join(map(str, state))
    if memo.has_key(key):
        return memo[key]
    memo[key] = c
    if pos!=0 and pos!=4:
        swap(state, pos-1, pos)
        dfs(state, pos-1, c+1)
        swap(state, pos-1, pos)
    if pos!=3 and pos!=7:
        swap(state, pos+1, pos)
        dfs(state, pos+1, c+1)
        swap(state, pos+1, pos)
    if pos<4:
        swap(state, pos+4, pos)
        dfs(state, pos+4, c+1)
        swap(state, pos+4, pos)
    else:
        swap(state, pos-4, pos)
        dfs(state, pos-4, c+1)
        swap(state, pos-4, pos)
    return c

dfs(range(8), 0, 0)
while True:
    try:
        state = raw_input().replace(" ","")
        print memo[state]
    except KeyError:
        pass
    except IOError:
        break

### FIXED CODE ###

import Queue
memo = {}
def swap(state, a, b):
    state2 = state[:]
    state2[a], state2[b] = state2[b], state2[a]
    return state2
gkey = lambda state: "".join(map(str, state))

que = Queue.Queue()

init = range(8)
que.put((init, 0, 0))
memo[gkey(init)] = 0
while not que.empty():
    state, pos, c = que.get()
    def next_state(nxt):
        state2 = swap(state, nxt, pos)
        key = gkey(state2)
        if not memo.has_key(key):
            memo[key] = c+1
            que.put((state2, nxt, c+1))
    if pos!=0 and pos!=4:
        next_state(pos-1)
    if pos!=3 and pos!=7:
        next_state(pos+1)
    if pos<4:
        next_state(pos+4)
    else:
        next_state(pos-4)
while True:
    try:
        print memo[raw_input().replace(" ", "")]
    except EOFError:
        break
import collections

n = int(input())
s = [input() for i in range(n)]
c = []
for i in s:
    c.append(collections.Counter(i))
a = c[0] & c[1]
for i in range(2, n):
    a &= c[i]
ans = []
a = a.most_common()
for i in a:
    for j in range(i[1]):
        ans.append(i[0])
print("".join(sorted(ans)))

### FIXED CODE ###

import collections

n = int(input())
s = [input() for i in range(n)]
if n == 1:
    print("".join(sorted(s[0])))
else:
    c = []
    for i in s:
        c.append(collections.Counter(i))
    a = c[0] & c[1]
    for i in range(2, n):
        a &= c[i]
    ans = []
    a = a.most_common()
    for i in a:
        for j in range(i[1]):
            ans.append(i[0])
    print("".join(sorted(ans)))
import sys
sys.setrecursionlimit(5000)

def step(n, A):
    memo = A
    def _step(n):
        if memo[n] != -1:
            return memo[n]
        elif n == 1:
            return 1
        elif n == 2:
            if memo[1] == 0:
                return 1
            else:
                return 2
        memo[n] = (_step(n-1) + _step(n-2))%(10**9+7)
        return memo[n]
    return _step(n)

N, M = map(int, input().split())
A = [-1] * (N+1)
for _ in range(M):
    idx = int(input())
    A[idx] = 0
print(step(N, A))


### FIXED CODE ###

N, M = map(int, input().split())
A = [True] * (N+1)
for _ in range(M):
  idx = int(input())
  A[idx] = False

step = [0] * (N+1)
step[0] = 1
for i in range(1, N+1):
  if A[i]:
    step[i] = step[i-1] + step[i-2]
  else:
    step[i] = 0
print(step[N]%(10**9+7))
n, m = map(int, input().split())
root = [-1] * n

def r(x):
    if root[x] < 0:
        return x
    else:
        root[x] = r(root[x])
        return root[x]
    

def unite(x, y):
    x = r(x)
    y = r(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x
    

def size(x):
    x = r(x)
    return -root[x]


for i in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    unite(x,y)

"""
max_size = 0
for i in range(n):
    max_size = max(size(i), max_size)
"""
max_size = max(map(size, range(n)))

print(max_size)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)

n, m = map(int, input().split())
root = [-1] * n

def r(x):
    if root[x] < 0:
        return x
    else:
        root[x] = r(root[x])
        return root[x]
    

def unite(x, y):
    x = r(x)
    y = r(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x
    

def size(x):
    x = r(x)
    return -root[x]


for i in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    unite(x,y)

"""
max_size = 0
for i in range(n):
    max_size = max(size(i), max_size)
"""
max_size = max(map(size, range(n)))

print(max_size)
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(100000)]
for i in V[::2]:
    d1[i]+=1
d2=[0 for i in range(100000)]
for i in V[1::2]:
    d2[i]+=1


if d1.index(max(d1)) == d2.index(max(d2)):
    if max(d1)>max(d2):
        d2[d2.index(max(d2))]=0
    else:
        d1[d1.index(max(d1))]=0

#print(d1[:5])
#print(d2[:5])
tmp1=n/2-max(d1)
tmp2=n/2-max(d2)
print(int(tmp1+tmp2))

### FIXED CODE ###

import copy
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(100000)]
for i in V[::2]:
    d1[i-1]+=1
d2=[0 for i in range(100000)]
for i in V[1::2]:
    d2[i-1]+=1

m1=max(d1)
m2=max(d2)
maxind1 = [i for i, x in enumerate(d1) if x == m1]
maxind2 = [i for i, x in enumerate(d2) if x == m2]

#in1=d1.index(max(d1))
#in2=d2.index(max(d2))



if (maxind1[0] == maxind2[0]) and (len(maxind1) == 1) and (len(maxind2) == 1):
    #if m1>m2:
    #d2[maxind2[0]]=0
    tmp=copy.copy(d2)
    tmp[maxind2[0]]=0
    result1=n-max(d1)-max(tmp)

    #else:
    #d1[maxind1[0]]=0
    tmp=copy.copy(d1)
    tmp[maxind1[0]]=0
    result2=n-max(tmp)-max(d2)
    print(int(min(result1,result2)))
else:
#print(d1[:5])
#print(d2[:5])
    tmp1=n/2-max(d1)
    tmp2=n/2-max(d2)
    print(int(tmp1+tmp2))
import math 

N2,M1 = map(int, input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(combinations_count(4, 2))

count = combinations_count(N2,2)

count += combinations_count(M1,2)

print(count)

### FIXED CODE ###

import math 

N2,M1 = map(int, input().split())
count=0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N2!=0 and N2!=1:
    count += combinations_count(N2,2)
if M1!=0 and M1!=1:
    count += combinations_count(M1,2)

print(count)
n,l = map(int,input().split())
S = sorted([input() for _ in range(n)])
print(*S,sep="")

### FIXED CODE ###

n = input().split()
print("YES" if n.count("5") == 2 and n.count("7") == 1 else "NO")
def binpow(x, e):
  a = 1.0 #結果変数の初期化
  p = x   #二乗値の初期化
  while e > 0:   #不定反復
    if e % 2 == 0: #指数が偶数のとき
      p *= p
      e /= 2     #二乗値の更新
    else:        #指数が奇数のとき
      a *= p
      e -= 1     #二乗値の乗算
  return a

n, p = [int(i) for i in input().split()]
num = int(p ** (1 / n)) + 1
for i in range(num):
    pp = p
    dv = num - i
    if pp % binpow(dv, n) == 0:
        ans = dv
        break
print(ans)

### FIXED CODE ###

n, p = [int(i) for i in input().split()]
if n >= 10 ** 4:
    print(1)
    exit()

num = int(p ** (1 / n)) + 1
for i in range(num):
    pp = p
    dv = num - i
    if pp % (dv ** n) == 0:
        ans = dv
        break
print(ans)
from collections import deque


n, m = map(int, input().split())
tree = [[] for i in range(n)]
path = {}
for i in range(m):
    tmp1, tmp2, cost = map(int, input().split())
    tree[tmp1-1].append([tmp2-1, cost])

q = deque()
q.append([-1, 0])
pos_cost = [-10**10]*n
pos_cost[0] = 0
path = {}

def judge(start):
    q2 = deque()
    q2.append(start)
    visited = [False]*n
    visited[start] = True
    while q2:
        pos = q2.popleft()
        for next_pos, cost in tree[pos]:
            if not visited[next_pos]:
                q.append(next_pos)
                visited[next_pos] = True
    if visited[n-1]:
        print("inf")
        exit()

while q:
    prev_pos, pos = q.popleft()
    if prev_pos*10000 + pos in path:
        judge(pos)
        continue
    path[prev_pos*10000 + pos] = 1
    for next_pos, cost in tree[pos]:
        if pos_cost[pos] + cost > pos_cost[next_pos]:
            pos_cost[next_pos] = pos_cost[pos] + cost
            q.append([pos, next_pos])
print(pos_cost[n-1])

### FIXED CODE ###

from collections import deque


n, m = map(int, input().split())
tree = [[] for i in range(n)]
path = {}
for i in range(m):
    tmp1, tmp2, cost = map(int, input().split())
    tree[tmp1-1].append([tmp2-1, cost])

q = deque()
q.append([-1, 0])
pos_cost = [-float("inf")]*n
pos_cost[0] = 0
path = {}

def judge(start):
    q2 = deque()
    q2.append(start)
    visited = [False]*n
    visited[start] = True
    while q2:
        pos = q2.popleft()
        for next_pos, cost in tree[pos]:
            if not visited[next_pos]:
                q2.append(next_pos)
                visited[next_pos] = True
    if visited[n-1]:
        print("inf")
        exit()

while q:
    prev_pos, pos = q.popleft()
    if prev_pos*10000 + pos in path:
        judge(pos)
        continue
    path[prev_pos*10000 + pos] = 1
    for next_pos, cost in tree[pos]:
        if pos_cost[pos] + cost > pos_cost[next_pos]:
            pos_cost[next_pos] = pos_cost[pos] + cost
            q.append([pos, next_pos])
print(pos_cost[n-1])
n, a, b = [int(x) for x in input().split()]
count = 0
for i in range(a, n+1):
	  if sum([int(x) for x in list(str(i))]) > b:
      	continue
      count += 1
print(count)

### FIXED CODE ###

n, a, b = [int(x) for x in input().split()]
count = 0
for i in range(a, n+1):
    if a <= sum([int(x) for x in list(str(i))]) <= b:
        count += i
print(count)
import itertools

def solve(W, N, v):
    cache = {}
    def loop(i, w):
        if (i, w) in cache:
            return cache[i, w]
        if i == N:
            return (0, 0)
        cache[i, w] = loop(i + 1, w)
        if v[i][1] <= w:
            t = loop(i + 1, w - v[i][1])
            cache[i, w] = max(cache[i, w], (t[0] + v[i][0], t[1] + v[i][1]), key=lambda u: u[0])
        return cache[i, w]
    return loop(0, W)

for dn in itertools.count(1):
    W = int(input())
    if W == 0: break
    N = int(input())
    v = [tuple(map(int, input().split(','))) for _ in range(N)]
    optim = solve(W, N, v)
    print("Case %d:\n%d\n%d" % (dn, optim[0], optim[1]))

### FIXED CODE ###

import itertools

for dn in itertools.count(1):
    W = int(input())
    if W == 0: break
    N = int(input())
    d = [tuple(map(int, input().split(','))) for _ in range(N)]

    v = [0 for _ in range(W + 1)]
    for i in range(N):
        for j in range(W, d[i][1] - 1, -1):
            v[j] = max(v[j], v[j - d[i][1]] + d[i][0])
    print("Case %d:\n%d\n%d" % (dn, max(v), v.index(max(v))))
from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()

cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)
f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0
        
    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    
    i+=1

print(sum(A))

### FIXED CODE ###

from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()


cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)

f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0

    if(N==crd_cnt):
        f=0

    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    elif(i+1==N):
        f=0
    
    i+=1

print(sum(A))
def wa(t):
    sum=0
    while t>0:
       sum+=t%10
       t=t//10
    return sum

n=int(input())
ans=[]
for i in range(2,n+1-2):
    ans.append(wa(i)+wa(n-i)) 
print(min(ans))

### FIXED CODE ###

def wa(t):
    sum=0
    while t>0:
       sum+=t%10
       t//=10
    return sum

n=int(input())
ans=[]
for i in range(1,n):
    ans.append(wa(i)+wa(n-i)) 
    if wa(i)+wa(n-i)==1:
        print(i)
print(min(ans))
N, M = input().split()
N = int(N)
M = int(M)
p = []
S = []
for i in range(M):
    a, b = input().split()
    a = int(a)
    p.append(a)
    S.append(b)
right = 0
wrong = 0
for j in range(M):
    if right[p[j] - 1] == 0:
        if S[k] == 'WA':
            wrong += 1
        elif S[k] == 'AC' and :
            right += 1
print(str(right) + ' ' + str(wrong))

### FIXED CODE ###

x = input()
y = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(26):
    if y[i] == x:
        print(y[i + 1])
# chessboard, manhattan distance even will noly be possible if parity is right

from math import sqrt
eps = 1e-5

# Utils
def solve2(A11,A12,A21,A22,b1,b2):
    """Solves a 2x2 matrix equation."""
    det = (A11*A22-A12*A21)
    if abs(det) < eps:
        return (None, None)

    return (1/det*(b1*A22-b2*A12), 1/det*(b2*A11-b1*A21))

def dot(a,b):
    """Returns the dot product"""
    return sum(a[i]*b[i] for i in range(len(a)))
    
def normalize(a):
    """Normalize vector to unit length"""
    norm = sqrt(dot(a,a))
    return tuple(x/norm for x in a)

def cross(a,b):
    """3D cross product"""
    return (a[1]*b[2] - a[2]*b[1],
            a[2]*b[0] - a[0]*b[2],
            a[0]*b[1] - a[1]*b[0])

# intpt,onsegment,t,s = ll_intersect(a,da,b,db)
def ll_intersect(a,da,b,db):
    """Given two segments, return line intersection, segments crossing and
       parameters at crossing"""
    dx, dy = a[0]-b[0], a[1]-b[1]
    s,t = solve2(db[0], -da[0], db[1], -da[1], dx, dy)

    if s == None:
        return (None, False, None, None)

    ipt = (a[0] + t*da[0], a[1] + t*da[1])
    
    # Epsilon treatment?
    if s < -eps or s > 1+eps or t < -eps or t > 1+eps:
        return (ipt, False, t, s)
    
    return (ipt, True, t, s)
    

def manhattan(x,y,s,t):
    return abs(x-s) + abs(y-t)

def main():
    k = int(input())
    xx,yy = map(int,input().split())
    if k % 2 == 0:
        if (xx+yy)%2:
            print('-1')
            return
    
    P = []

    while (xx,yy) != (0,0):
        P.append((xx,yy))
        if manhattan(0,0,xx,yy) <= 2*k:
            Sorig = [[(-k,0),(k,k)],
                    [(0,k),(k,-k)],
                    [(k,0),(-k,-k)],
                    [(0,-k),(-k,k)]]
            S = [[(pos[0]+xx,pos[1]+yy),diff] for pos,diff in Sorig]
            
            inter = []
            for pp,dd in S:
                for pp2,dd2 in Sorig:
                    pt,onseg,_,_ = ll_intersect(pp,dd,pp2,dd2)
                    if onseg:
                        ix,iy = pt
                        if (ix - round(ix)) < eps and (iy - round(iy)) < eps:
                            inter.append((int(round(ix)),int(round(iy))))

            for ix,iy in inter:
                ix,iy = inter[-1]
                if manhattan(0,0,ix,iy) == k and manhattan(ix,iy,xx,yy) == k:
                    P.append((ix,iy))
                    P.append((0,0))
                    break
            if P[-1] == (0,0):
                break

        if xx < 0:
            signx = -1
            xx *= -1
        else:
            signx = 1

        if yy < 0:
            signy = -1
            yy *= -1
        else:
            signy = 1

        togo = k
        mn = min(togo,xx)
        xx -= mn
        togo -= mn
        yy -= togo

        xx *= signx
        yy *= signy

    for i in range(len(P)-1):
        assert abs(P[i][0] - P[i+1][0]) + abs(P[i][1] - P[i+1][1]) == k

    print(len(P)-1)
    for x,y in P[:-1][::-1]:
        print(x,y)

main()


### FIXED CODE ###

a,b = map(int,input().split())
k = (a+b)//2

if abs(a-k) == abs(b-k):
    print(k)
else:
    print('IMPOSSIBLE')
a,b,k=map(int,input().split())
if(k>a):
  a=0
  k=k-a
  if(k>=b):
    b=0
  else:
    b=b-k
else:
  a=a-k

print("{} {}".format(a,b))
  

### FIXED CODE ###

s=input().split()
print("{}{}".format(s[1],s[0]))
a,b = map(int,input())
if a == b or a > b:
  print(a)
else:
  print(b)


### FIXED CODE ###

a,b = map(int,input().split())
if a > b:
  print(a-1)
elif a == b:
  print(a)
else:
  print(a)
N,M=map(int,input().split())

a=list(map(int,input().split()))
a=sorted(a)
a.append(0)
D=[]
for i in range(M):

    d=list(map(int,input().split()))

    D.append(d)

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


k=0

for j in range(M):
    l=k
    for i in range(D[M-j-1][0]):

        if D[M-j-1][1] > a[k]:
            a[k]=D[M-j-1][1]
            k=k+1
        if l==k:
            break

    if l==k:
        break

print(sum(a)-a[N])



### FIXED CODE ###

N,M=map(int,input().split())

a=list(map(int,input().split()))
a=sorted(a)
a.append(0)
D=[]
for i in range(M):

    d=list(map(int,input().split()))

    D.append(d)

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


k=0

for j in range(M):
    l=k
    for i in range(D[M-j-1][0]):
        q=max(M-j-1,0)
        if D[q][1] > a[k] and k!=N:
            a[k]=D[q][1]
            k=k+1
        else:
            k=k

        if l==k:
            break

    if l==k:
        break



print(sum(a)-a[N])
a, b= map(int,open(0).read().split())

if (a >=13):
    print (b)
else if(a<=12 and a>=6):
    print(b //2)
else:
    print(0)

### FIXED CODE ###

a, b= map(int,open(0).read().split())

if (a >=13):
    print (b)
elif(a<=12 and a>=6):
    print(b // 2)
else:
    print(0)
a,b=map(int,input())
if a<13:
  if 5<a:
    print(b/2)
  else:
    print(0)
else:
  print(b)


### FIXED CODE ###

a,b=map(int,input().split())
if a<13:
  if 5<a:
    print(b//2)
  else:
    print(0)
else:
  print(b)
a,b,x=map(int,input().split())
print(["NO","YES"]][a>x])

### FIXED CODE ###

a,b,x=map(int,input().split())
print(["NO","YES"][a<=x<a+b])
a, b = map(int, input().split())

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

g = gcd(a, b)

common = []
for i in range(1, int(g**0.5)+1):
    if g%i == 0:
        common.append(i)
        common.append(g//i)

import math
def Eratosthenes(n):
    if n < 2:
        return None
    prime = [2]
    limit = math.ceil(n**0.5)
    data = list(range(3, n+1, 2))
    p = -1
    while p < limit:
        p = data[0]
        prime.append(p)
        data = [d for d in data if d%p != 0]
    return prime + data

prime = Eratosthenes(max(common))

print(1 + len(set(common) & set(prime)))

### FIXED CODE ###

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
 
a, b = map(int, input().split())
print(len(set(prime_factorize(a)) & set(prime_factorize(b))) + 1)
x=int(input())
l=[]
for i in range(1,x+1):
    for j in range(1,x+1):
        if j*j==i:
            l.append(j*j)
        if j*j*j==i:
            l.append(j*j*j)
        if j*j*j*j==i:
print(max(l))

### FIXED CODE ###

x=int(input())
ans=1
for i in range(1,x+1):
    for j in range(2,50):
        for k in range(2,50):
            if i==j**k:
                ans=j**k
print(ans)
from math import *
import sympy
def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)
    return divisors

def eratosthenes(n):
    table = [0] * (n + 1)
    prime_list = []
    
    for i in range(2, n + 1):
        if table[i] == 0:
            prime_list.append(i)
            for j in range(i + i, n + 1, i):
                table[j] = 1
                
    return prime_list
a,b = map(int,input().split())
upper = int(sqrt(min(a,b))) + 1
pl = set(eratosthenes(upper))
common_factor = make_divisors(a)&make_divisors(b)
#print(*sorted(list(common_factor)))
#common_factor = [ i for i in range(1,min(a,b)) if a % i == 0 and b % i == 0]
#print(*common_factor)
ans = 0
for i in common_factor:
    if i in pl:
        ans += 1
print(ans + 1)

### FIXED CODE ###

def factorize(n):
    fct = []
    b,e = 2,0
    while b*b <= n:
        while n % b == 0:
            n //= b
            e += 1
        if e > 0:
            fct.append((b,e))
        b,e = b+1,0
    if n > 1:
        fct.append((n,1))
    return fct
a,b = map(int,input().split())
ap = set()
for prime,count in factorize(a):
    ap.add(prime)
bp = set()
for prime,count in factorize(b):
    bp.add(prime)
print(len(ap&bp)+1)
n = int(input())
*A, = map(int, input().split())
# C[a] = A内のaの個数
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in A}
for a in A:
    if C[a] > 0:
        tmp = 2
        while a * tmp <= maxA:
            D[a * tmp] = 1
            tmp += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)


### FIXED CODE ###

n = int(input())
*A, = map(int, input().split())
maxA = max(A)
# C[a] = A内のaの個数
C = {a: 0 for a in range(1, maxA + 1)}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in range(1, maxA + 1)}
for a in A:
    if C[a] > 0:
        tmp = 2
        while a * tmp <= maxA:
            D[a * tmp] = 1
            tmp += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)
s = list(input())
if len(s) == 3:
    print(s[::-1].join())
else:
    print(s.join())

### FIXED CODE ###

s = list(input())
if len(s) == 3:
    print("".join(s[::-1]))
else:
    print("".join(s))
from collections import defaultdict
dic=defaultdict(int)
n=int(input())
for _ in range(n): dic[input()]+=1
lis=sorted(dic.items(),key=lambda x:x[1],reverse=True)
M=lis[0][1]
ans=[]
for i in range(n):
    if lis[i][1]==M: ans.append(lis[i][0])
    else: break
ans.sort()
for i in ans: print(i)

### FIXED CODE ###

from collections import defaultdict
dic=defaultdict(int)
n=int(input())
for _ in range(n): dic[input()]+=1
lis=sorted(dic.items(),key=lambda x:x[1],reverse=True)
M=lis[0][1]
ans=[]
for i in range(len(lis)):
    if lis[i][1]==M: ans.append(lis[i][0])
    else: break
ans.sort()
for i in ans: print(i)
S = input()
T = input()

if(S==T[0:len(S)]):
  print(Yes)
 else:
    print(No)
	



### FIXED CODE ###

A, B, C, K = map(int, input().split())
if((K-A)>0):
    Y = K-A
else:
    print(K)
    exit()
if((Y-B)>0):
    Z = Y-B
else:
    Z = 0

X = A + 0 * Y + (-1) * Z
print(X)
mod = ( a * b )%2

if mod == 0:
  print'Even'
else:
  print'Odd'

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')
N = int(input())
P = [[int(i) for i in input().split(" ")]for _ in range(N)]

min_point = 100
for i in range(N-1):
	for j in range(i+1, N):
		p = P[i]
		q = P[j]
		if p[0] <=  q[0] and p[1] <= q[1]:
			x = q[0]-p[0]
			y = q[1]-p[1]
			point = 0
			mp = [False for _ in range(N)]
			count = N
			index = 0
			qu = queue.Queue()
			while count:
				if not mp[index]:
					point += 1
					qu.put(P[index])
					mp[index] = True
					count -= 1
					while not qu.empty():
						top = qu.get()
						for k in range(N):
							if not mp[k] and ((top[0]-x == P[k][0] and top[1]-y == P[k][1]) or (top[0]+x == P[k][0] and top[1]+y == P[k][1])):
								count -= 1
								qu.put(P[k])
								mp[k] = True
				index += 1
			if point < min_point:
				min_point = point

print(min_point)




### FIXED CODE ###

import queue

"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
N = int(input())
P = [[int(i) for i in input().split(" ")]for _ in range(N)]

min_point = 100
for i in range(N-1):
	for j in range(i+1, N):
		p = P[i]
		q = P[j]
		if p[0] <=  q[0]:
			x = q[0]-p[0]
			y = q[1]-p[1]
			point = 0
			mp = [False for _ in range(N)]
			count = N
			index = 0
			qu = queue.Queue()
			while count:
				if not mp[index]:
					point += 1
					qu.put(P[index])
					mp[index] = True
					count -= 1
					while not qu.empty():
						top = qu.get()
						for k in range(N):
							if not mp[k] and ((top[0]-x == P[k][0] and top[1]-y == P[k][1]) or (top[0]+x == P[k][0] and top[1]+y == P[k][1])):
								count -= 1
								qu.put(P[k])
								mp[k] = True
				index += 1
			if point < min_point:
				min_point = point
if N == 1:
	min_point = 1
print(min_point)