Harryxun/stf_run huggingface dataset:
s=input()
n=len(s)

def rle(s):
    tmp, cnt, ans = s[0], 1, ''
    for i in range(1, len(s)):
        if tmp == s[i]:
            cnt += 1
        else:
            ans += tmp+str(cnt)
            tmp = s[i]
            cnt = 1
    ans += tmp+str(cnt)
    return ans

rle_s=list(rle(s))
ans=[0]*n
sum_cnt=0
for i in range(0,len(rle_s),4):
    r_num=int(rle_s[i+1])
    l_num=int(rle_s[i+3])
    odd_num=(r_num+l_num+1)//2
    even_num=r_num+l_num-odd_num

    if r_num%2==0:
        ans[sum_cnt+r_num-1]=even_num
        ans[sum_cnt+r_num]=odd_num
    else:
        ans[sum_cnt+r_num-1]=odd_num
        ans[sum_cnt+r_num]=even_num

    sum_cnt+=r_num+l_num
    # print(r_num,l_num,odd_num,even_num)

print(*ans)


### FIXED CODE ###

s=input()
n=len(s)

def rle(string):
    tmp = string[0]
    cnt = 1
    ans = []
    for i in range(1, len(string)):
        if tmp == string[i]:
            cnt += 1
        else:
            ans.append(tmp)
            ans.append(cnt)
            tmp = string[i]
            cnt = 1
    ans.append(tmp)
    ans.append(cnt)
    return ans

rle_s=list(rle(s))
# print(rle_s)
ans=[0]*n
sum_cnt=0

for i in range(0,len(rle_s),4):
    r_num=int(rle_s[i+1])
    l_num=int(rle_s[i+3])
    odd_num=r_num//2+(l_num+1)//2
    even_num=r_num+l_num-odd_num

    ans[sum_cnt+r_num-1]=even_num
    ans[sum_cnt+r_num]=odd_num

    sum_cnt+=(r_num+l_num)
    # print(r_num, l_num, odd_num, even_num, sum_cnt)

print(*ans)
import math
def main():
    N, K = map(int, input().split())
    l = [0] * (math.ceil(math.log2(K)) + 1)
    t = 2
    for i in range(len(l)):
        l[i] = t * 1/2
        t = l[i]
    p = 0
    for i in range(1, min(K, N+1)):
        p += l[math.ceil(math.log2(K/i))]
    p += max(N-K + 1, 0)
    p /= N
    return p

print(main())


### FIXED CODE ###

import math
def main():
    N, K = map(int, input().split())
    l = [0] * (math.ceil(math.log2(K)) + 1)
    t = 2
    for i in range(len(l)):
        l[i] = t * 1/2
        t = l[i]
    p = 0
    for i in range(1, min(K, N+1)):
        p += l[math.ceil(math.log2(K/i))]
    p += max(N-K + 1, 0)
    p /= N
    return p

print(main())
k = input()

if k%2 ==0:
    print((k/2)*(k/2))
else:
    print(((k-1)/2)*((k+1)/2))


### FIXED CODE ###

k = int(input())


if k%2 ==0:
    print(int((k/2)*(k/2)))
else:
    print(int(((k-1)/2)*((k+1)/2)))
a[0] = input()
a[1] = input()
print a[0] + a[1]

### FIXED CODE ###

L,R = input().split()
k = R + L
print (k)
import sys
S = input()
Q = int(input())
pin = 0
for i in range(Q):
  t = list(sys.stdin.readline().split())
  if int(t[0]) == 1:
    if pin == 1:
      pin = 0
    else:
      pin = 1
  else:
    if int(t[1]) % 2 == pin :
      S = S + t[2]
    else:
      S = t[2] + S
if pin == 1:
  S = S[::-1]
print(S)


### FIXED CODE ###

S = input()
if S[0] == S[1] and S[1] == S[2] :
  print('No')
else:
  print('Yes')
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

### FIXED CODE ###

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


a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')
import numpy as np
import concurrent.futures as confu

def cou(i):
		if i % c != 0:
			if i % d != 0:
				return 1
		return 0
		
		
a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
count = 0
with confu.ThreadPoolExecutor() as ex:
	th = ex.map(cou, range(a,b))
	for i in th:
		count += i
print(count)

### FIXED CODE ###

import fractions

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - ((a-1) // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))
from sys import exit, stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
count, ignore = 0, 0
for i, a in enumerate(A):
    if ignore == 1:
        ignore = 0
        continue
    if a-1 == i:
        count += 1
        if A[i+1] != i+1:
            ignore = 1
print(count)

### FIXED CODE ###

from sys import exit, stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
count, ignore = 0, 0
for i, a in enumerate(A):
    if ignore == 1:
        ignore = 0
        continue
    if a-1 == i:
        count += 1
        if i != N-1:
            if A[i+1] != i+1:
                ignore = 1
print(count)
N,K = map(int,input().split())
S = list(input())

State = [0] * N
counter0 = 0
counter1 = 0
flag = -1
jj = 0
for i in range(N):
    if S[i] == '0':
        if flag == 1:
            State[jj] = counter1
            jj +=1
            counter1 = 0
        counter0 += 1
        flag = 0
    if S[i] == '1':
        if flag == 0:
            State[jj] = counter0
            jj += 1
            counter0 = 0
        counter1 += 1
        flag = 1
    if i == N-1:
        State[jj] = max(counter0,counter1)
        

State = int(S[0] == '0') * [0] + State[:]
N2 = len(State)
ans = 0
total = 0
K2 = 2*K+1

if K2 >= N2:
    K2 = N2

for i in range(K2):
    total += State[i]
        
ans = total
for i in range(0,N2-K2,2):
    total2 = total - State[i] - State[i+1] + State[i+K2] + State[i+1+K2]
    ans = max(ans,total2)
    total = total2
    
print(ans)

### FIXED CODE ###

import numpy as np

N,K = map(int,input().split())
S = list(input())

State = [0] * N
counter0 = 0
counter1 = 0
flag = -1
jj = 0
for i in range(N):
    if S[i] == '0':
        if flag == 1:
            State[jj] = counter1
            jj +=1
            counter1 = 0
        counter0 += 1
        flag = 0
    if S[i] == '1':
        if flag == 0:
            State[jj] = counter0
            jj += 1
            counter0 = 0
        counter1 += 1
        flag = 1
    if i == N-1:
        State[jj] = max(counter0,counter1)
        
N2 = np.count_nonzero(State)
State = int(S[0] == '0') * [0] + State[:N2] + int(S[N-1] == '0') * [0]
N2 = len(State)
ans = 0
total = 0
K2 = 2*K+1

if K2 >= N2:
    K2 = N2

for i in range(K2):
    total += State[i]
        
ans = total
for i in range(0,N2-K2,2):
    total2 = total - State[i] - State[i+1] + State[i+K2] + State[i+1+K2]
    ans = max(ans,total2)
    total = total2
    
print(ans)
import sys, os

f = lambda:list(map(int,input().split()))
a = ["dream", "dreamer", "erase", "eraser"]
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

t = input().strip()


def dfs(somes):
    if somes == t:
        return True
    
    if len(somes)>= len(t):
        return False
    
    temp = somes

    for i in a:
        if dfs(somes+i):
            return True
    
    return False

def solve():
    s = ""
    if dfs(s):
        print("YES")
    else:
        print("NO")

solve()


### FIXED CODE ###

import sys, os

f = lambda:list(map(int,input().split()))
a = ["dream", "dreamer", "erase", "eraser"]
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

t = input().strip()
t = t[::-1]

def solve():
    s = ""
    for i in range(len(a)):
        a[i] = a[i][::-1]


    end = 0
    lent = len(t)
    while(len(s)<len(t)):
        ok = False
        for i in a:
            if len(s) + len(i) <= lent and i == t[len(s): len(s) + len(i)]:
                s += i
                ok = True

        if ok == False:
            print("NO")
            return
    
    print("YES")

solve()
H,W=map(int, input().split())
S=[input() for _ in range(H)]
 
U=[[-1]*W for _ in range(H)]
D=[[-1]*W for _ in range(H)]
L=[[-1]*W for _ in range(H)]
R=[[-1]*W for _ in range(H)]
 
def u(i,j):
    if S[i][j]=='#':
        U[i][j]==-2
    elif i==0:
        U[i][j]=0
    elif U[i-1][j]==-1:
        u(i-1,j)
        if U[i-1][j]==-2:
            U[i][j]=0
        else:
            U[i][j]=U[i-1][j]+1
    elif U[i-1][j]==-2:
        U[i][j]=0
    else:
        U[i][j]=U[i-1][j]+1
 
def d(i,j):
    if S[i][j]=='#':
        D[i][j]==-2
    elif i==H-1:
        D[i][j]=0
    elif D[i+1][j]==-1:
        d(i+1,j)
        if D[i+1][j]==-2:
            D[i][j]=0
        else:
            D[i][j]=D[i+1][j]+1
    elif D[i+1][j]==-2:
        D[i][j]=0
    else:
        D[i][j]=D[i+1][j]+1
 
def l(i,j):
    if S[i][j]=='#':
        L[i][j]==-2
    elif j==0:
        L[i][j]=0
    elif L[i][j-1]==-1:
        l(i,j-1)
        if L[i][j-1]==-2:
            L[i][j]=0
        else:
            L[i][j]=L[i][j-1]+1
    elif L[i][j-1]==-2:
        L[i][j]=0
    else:
        L[i][j]=L[i][j-1]+1
 
def r(i,j):
    if S[i][j]=='#':
        R[i][j]==-2
    elif j==W-1:
        R[i][j]=0
    elif R[i][j+1]==-1:
        r(i,j+1)
        if R[i][j+1]==-2:
            R[i][j]=0
        else:
            R[i][j]=R[i][j+1]+1
    elif R[i][j+1]==-2:
        R[i][j]=0
    else:
        R[i][j]=R[i][j+1]+1
 
def udlr(i,j):
    if S[i][j]=='#':
        U[i][j]=D[i][j]=L[i][j]=R[i][j]=-2
        return 0
    else:
        if U[i][j]==-1:
            u(i,j)
        if D[i][j]==-1:
            d(i,j)
        if L[i][j]==-1:
            l(i,j)
        if R[i][j]==-1:
            r(i,j)
        return U[i][j]+D[i][j]+L[i][j]+R[i][j]+1
 
x=0
for i in range(H):
    for j in range(W):
        x=max(x,max(x,udlr(i,j)))
print(x)

### FIXED CODE ###

H,W = map(int,input().split())
G=[input() for _ in range(H)]
A_u=[[0 for _ in range(W)] for _ in range(H)]
A_d=[[0 for _ in range(W)] for _ in range(H)]
A_r=[[0 for _ in range(W)] for _ in range(H)]
A_l=[[0 for _ in range(W)] for _ in range(H)]
for h in range(H):
  for w in range(1,W):
    if G[h][w-1] == '.':
      A_r[h][w] = A_r[h][w-1]+1
  for w in range(W-2,-1,-1):
    if G[h][w+1] == '.':
      A_l[h][w] = A_l[h][w+1]+1
for w in range(W):
  for h in range(1,H):
    if G[h-1][w] == '.':
      A_d[h][w] = A_d[h-1][w]+1
  for h in range(H-2,-1,-1):
    if G[h+1][w] == '.':
      A_u[h][w] = A_u[h+1][w]+1
ans=0
for h in range(H):
  for w in range(W):
    if G[h][w] == '.':
      ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1)
print(ans)
n=int(input())
a=[int(i) in input().split()]
a.sort()[::-1]
print(sum[1:2*n:2])

### FIXED CODE ###

n=int(input())
a=sorted([int(i) for i in input().split()])[::-1]
print(sum(a[1:2*n:2]))
import math
n = input();
for var in range(0, int(n)) :
	c1 = input();
	c2 = input();
	sum = int(c1) + int(c2);
	if(math.log10(sum) + 1 > 80) :
		print("overflow");
	else :
		print(sum);

### FIXED CODE ###

for _ in range(int(input())) :
    n = int(input()) + int(input())
    if (n >= 10 ** 80) :
        print("overflow")
    else :
        print(n)
x = int(input())
l_len = x // 100
l_sum = x % 100
def issum(lis, l_sum, l_len, curr_sum, curr_len):
#     print(curr_sum)
    if curr_sum > l_sum or curr_len > l_len:
        return
    if curr_sum == l_sum and curr_len == l_len:
        return True
    for i in range(l_len):
        if issum(lis, l_sum, l_len, curr_sum + lis[i], curr_len + 1):
            return True
a = [0, 1, 2, 3, 4, 5]
if issum(a, l_sum, l_len, 0, 0):
  print(1)
else:
  print(0)

### FIXED CODE ###

x = int(input())
if x < 100:
    print(0)
    exit()

l_num = x // 100
l_sum = x % 100

if l_sum <= l_num * 5:
    print(1)
else:
    print(0)
a,b,q = map(int,input().split())
s = [-float('inf')]+[int(input()) for i in range(a)]+[float('inf')]
t = [-float('inf')]+[int(input()) for i in range(b)]+[float('inf')]
x = [int(input()) for i in range(q)]
import bisect
for x_ in x:
    s_r = bisect.bisect_right(s,x_)
    t_r = bisect.bisect_right(s,x_)
    res = INF
    for S in [s[s_r-1],s[s_r]]:
        for T in [t[t_r-1],t[t_r]]:
            d1 = abs(S-x_)+abs(T-S)
            d2 = abs(T-x_)+abs(S-T)
            res = min(res,d1,d2)
    print(res)

for ans_ in ans:
    print(ans_)

### FIXED CODE ###

a,b,q = map(int,input().split())
s = [-float('inf')]+[int(input()) for i in range(a)]+[float('inf')]
t = [-float('inf')]+[int(input()) for i in range(b)]+[float('inf')]
x = [int(input()) for i in range(q)]
import bisect
for x_ in x:
    s_r = bisect.bisect_right(s,x_)
    t_r = bisect.bisect_right(t,x_)
    res = float('inf')
    for S in [s[s_r-1],s[s_r]]:
        for T in [t[t_r-1],t[t_r]]:
            d1 = abs(S-x_)+abs(T-S)
            d2 = abs(T-x_)+abs(S-T)
            res = min(res,d1,d2)
    print(res)
a = input()
if len(a) ==6:
  print(90909)
elif len(a) == 5:
  print(90909-90000 +int(a)-9999)
elif len(a) == 4:
  print(90909-90000)
elif len(a) ==3:
  print(90909-90000-900b+int(a)-99)
elif len(a) ==2:
  print(90909-90000-900)
else:
  print(int(a))
  

### FIXED CODE ###

a = input()
if len(a) ==6:
  print(90909)
elif len(a) == 5:
  print(90909-90000 +int(a)-9999)
elif len(a) == 4:
  print(90909-90000)
elif len(a) ==3:
  print(90909-90000-900+int(a)-99)
elif len(a) ==2:
  print(90909-90000-900)
else:
  print(int(a))
import math

a, b, k = map(int, input().split())
a_list = list(map(int, input().split()))
a_list  = a_list[::-1]

b_list = list(map(int, input().split()))
b_list  = b_list[::-1]

list_ = []
cnt=0
finish_flg = False
jikan = 0
while (len(a_list)!=0) & (len(b_list)!=0):
  a_top = a_list[-1]
  b_top = b_list[-1]

  if a_top<b_top:
    list_.append(a_top)
    a_list.pop()
  else:
    list_.append(b_top)
    b_list.pop()
    
list_ = list_ + a_list + b_list

if sum(list_)<=k:
  print(len(list_))
else:
  left = 0
  right = len(list_)
  while abs(left-right)>1:
    mid = (left+right) // 2
    if sum(list_[:mid])<=k:
      left = mid
    else:
      right = mid

  print(len(list_[left]))

### FIXED CODE ###

n, m, k = map(int, input().split(' '))
a_list = list(map(int, input().split(' ')))
b_list = list(map(int, input().split(' ')))
sa = [0] * (n+1)
sb = [0] * (m+1)

for i in range(n):
  sa[i+1] = a_list[i] + sa[i]
for j in range(m):
  sb[j+1] = b_list[j] + sb[j]

best=0
r = m
for i, a in enumerate(sa):
  if a>k:
    break
  while ((a + sb[r]) > k) & (r>=0):
    r-=1
    
  best = max(best,i+r)
      
  
    
print(best)
n,k=map(int,input().split())
s=list(input())
s=list(map(int,s))
stack=[]
tmp=1
for i in range(1,len(s)):
  if s[i]!=s[i-1]:
    stack.append(tmp)
    tmp=1
  else:
    tmp+=1
stack.append(tmp)
acc=[]
acc2=[]
ans=0
if s[0]==1:
  Acc=stack[0]
  Acc2=0
  acc.append(Acc)
  acc2.append(0)
  for i in range(1,len(stack)-len(stack)%2,2):
    Acc+=stack[i]
    Acc+=stack[i+1]
    acc.append(Acc)
    Acc2+=stack[i-1]
    Acc2+=stack[i]
    acc2.append(Acc2)
  if len(stack)%2==1:
    Acc+=stack[-1]
    acc.append(Acc)
    Acc2+=stack[-2]
    Acc2+=stack[-1]
    acc2.append(Acc2)
  for i in range(len(acc)-k-1):
    ans=max(ans,acc[i+k]-acc2[i])
if s[0]==0:
  Acc=stack[0]
  Acc2=0
  acc.append(0)
  acc.append(Acc)
  acc2.append(0)
  for i in range(1,len(stack)-len(stack)%2,2):
    Acc+=stack[i]
    Acc+=stack[i+1]
    acc.append(Acc)
    Acc2+=stack[i-1]
    Acc2+=stack[i]
    acc2.append(Acc2)
  if len(stack)%2==1:
    Acc+=stack[-1]
    acc.append(Acc)
    Acc2+=stack[-2]
    Acc2+=stack[-1]
    acc2.append(Acc2)
  for i in range(len(acc)-k-1):
    ans=max(ans,acc2[i+k]-acc[i])
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
s=list(input())
s=list(map(int,s))
stack=[]
tmp=0
now=1
for i in range(n):
  if s[i]==now:
    tmp+=1
  else:
    stack.append(tmp)
    tmp=1
    now=1-now
stack.append(tmp)
if len(stack)%2==0:
  stack.append(0)
Acc=[0]*(len(stack)+1)
for i in range(len(stack)):
  Acc[i+1]=Acc[i]+stack[i]
ans=0
for i in range(0,len(stack),2):
  left = i
  right = min(i+k*2+1,len(stack))
  ans=max(ans,Acc[right]-Acc[left])
print(ans)
from bisect import bisect_left
from collections import defaultdict
N, K, *A = map(int, open('0').read().split())
dic = defaultdict(list)
for i, a in enumerate(A):
  dic[a] += [i]
ls = []
ps = 0
m = A[0]
cycle = 0
while True:
  ls.append(ps+N*cycle+1)
  i = bisect_left(dic[m],ps+1)
  ps = dic[m][i%len(dic[m])]
  if i>=len(dic[m]):
    cycle += 1
  ps += 1
  ps %= N
  m = A[ps]
  if ps==0:
    cycle += 1
    break
k = K%cycle
j = bisect_left(ls,k*N)
if ls[j]==k*N:
  c = (ls[j]-1)%N
  print(A[c])
elif ls[j]==k*N+1:
  pass
else:
  c = (ls[j-1]-1)%N
  M = k*N-ls[j-1]
  ans = [A[c]]
  log = set(ans)
  ind = {}
  ind[A[c]] = 0
  cnt = 0
  while M:
    c += 1
    c %= N
    cnt += 1
    cnt %= N
    M -= 1
    if not A[c] in log:
      log.add(A[c])
      ind[A[c]] = cnt
      ans += [A[c]]
    else:
      log.remove(A[c])
      ans = ans[:ind[A[c]]]
      cnt = ind[A[c]]-1
  print(*ans)

### FIXED CODE ###

from bisect import bisect_left
from collections import defaultdict
N, K, *A = map(int, open(0).read().split())
dic = defaultdict(list)
for i, a in enumerate(A):
  dic[a] += [i]
ls = []
ps = 0
m = A[0]
cycle = 0
while True:
  ls.append(ps+N*cycle+1)
  i = bisect_left(dic[m],ps+1)
  ps = dic[m][i%len(dic[m])]
  if i>=len(dic[m]):
    cycle += 1
  ps += 1
  ps %= N
  m = A[ps]
  if ps==0:
    cycle += 1
    break
k = K%cycle
j = bisect_left(ls,k*N)
if ls[j]==k*N:
  c = (ls[j]-1)%N
  print(A[c])
elif ls[j]==k*N+1:
  pass
else:
  c = (ls[j-1]-1)%N
  M = k*N-ls[j-1]
  ans = [A[c]]
  log = set(ans)
  ind = {}
  ind[A[c]] = 0
  cnt = 0
  while M:
    c += 1
    c %= N
    cnt += 1
    cnt %= N
    M -= 1
    if not A[c] in log:
      log.add(A[c])
      ind[A[c]] = cnt
      ans += [A[c]]
    else:
      log.remove(A[c])
      ans = ans[:ind[A[c]]]
      log = set(ans)
      cnt = ind[A[c]]-1
  print(*ans)
S = ['0'] + list(input())

def g(i):
    if i == 0:
        return 0
    if i == 1:
            return 1
    if i == 2:
        if S[2] == S[1]:
            return 1
        else:
            return 2     

    if S[i] == S[i - 1]:
        return g(i - 3) + 2
    if S[i] != S[i - 1]:
        return g(i - 1) + 1
# print (len(S) - 1)
print (g(len(S) - 1))

### FIXED CODE ###

S = ['0'] + list(input())
N = len(S)

ans = 0
flag = False #直前の文字を使って2文字にするとき True
for i in range(1, N):
    #同じ文字が連続している時
    if S[i] == S[i - 1]:
        # print ('A')
        if flag == True: #その前に連続で使っているとき
            ans += 1
            flag = False
        elif flag == False: #その前を不連続で使っているとき
            flag = None
        elif flag == None:
            ans += 1
            flag = True

    #直前の文字と異なるとき-->1文字だけで使う
    elif S[i] != S[i - 1]:
        # print ('B')
        if flag == True: #直前が連続
            ans += 1
            flag = False
        elif flag == False: #直前が不連続
            ans += 1
            flag = False
        elif flag == None:
            ans += 1
            flag = True

print (ans)
from sys import stdin
n = int(stdin.readline().rstrip())
data = [[int(s) for s in stdin.readline().rstrip().split()] for _ in range(n)]
d = {}

for i in range(n):
  for j in range(i + 1, n):
    diff = (data[i][0] - data[j][0], data[i][1] - data[j][1])
    if diff in d:
      d[diff] += 1
    else:
      d[diff] = 1
    diff = (data[j][0] - data[i][0], data[j][1] - data[i][1])
    if diff in d:
      d[diff] += 1
    else:
      d[diff] = 1

print(n - max(d.values()))

### FIXED CODE ###

from sys import stdin
n = int(stdin.readline().rstrip())
data = [[int(s) for s in stdin.readline().rstrip().split()] for _ in range(n)]
d = {}

for i in range(n):
  for j in range(i + 1, n):
    diff = (data[i][0] - data[j][0], data[i][1] - data[j][1])
    if diff in d:
      d[diff] += 1
    else:
      d[diff] = 1
    diff = (data[j][0] - data[i][0], data[j][1] - data[i][1])
    if diff in d:
      d[diff] += 1
    else:
      d[diff] = 1

if len(d) == 0:
  print(n)
else:
  print(n - max(d.values()))
n = int(input())
lis = map(int,input().split())
m = 0
b = True
while(b):
  for index,l in enumerate(lis):
    if l % 2 == 1:
      b = False
      m -= 1
      break
    else:
      lis[index] = l // 2
  m += 1
print(m)


### FIXED CODE ###

n = int(input())
lis = list(map(int,input().split()))
m = 0
b = True
while(b):
  for index,l in enumerate(lis):
    if l % 2 == 1:
      b = False
      m -= 1
      break
    else:
      lis[index] = l / 2
  m += 1
print(m)
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // (max(math.gcd(c,d),1))
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

### FIXED CODE ###

import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)
n = int(input())

class Hash:
    def __init__(self):
        self.m = 1000003
        self.T = [None] * self.m
    def insert(self, key):
        i = 0
        while True:
            j = self.h(key, i)
            if i >0:
            if self.T[j] == None:
                self.T[j] = key
                break
            else:
                i = i + 1
    def search(self, key):
        i = 0
        while True:
            j = self.h(key, i)
            if self.T[j] == key:
                return j
            elif self.T[j] == None:
                return None
            else:
                i += 1
        return self.T[self.h(key)]
    def h(self, key, i):
        ki = self.key2int(key)
        h1 = ki % self.m
        h2 = i * (1 + (ki % (self.m - 1)))
        return (h1 + h2) % self.m
    def key2int(self, key):
        return sum([['A', 'C', 'G', 'T'].index(s) + 1 for s in key])

h = Hash()
for i in range(n):
    op, st = input().split()
    if op == 'insert':
        h.insert(st)
    else:
        if h.search(st):
            print('yes')
        else:
            print('no')

### FIXED CODE ###

n = int(input())
h = {}

for i in range(n):
    op, st = input().split()
    if op == 'insert':
        h[st] = 'yes'
    else:
        print (h.get(st, 'no'))