Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

h,w = map(int,input().split())
n = h * w
raw = []
for i in range(h):
  tmp = input()
  add = []
  for j in range(w):
    if tmp[j] == '.':
      add.append(0)
    else:
      add.append(1)
  raw += add
wf = [[100 for _ in range(n)] for _ in range(n)]
for i in range(n):
  if raw[i] == 0:
    wf[i][i] = 0
    d = []
    if i-w >= 0:
      d.append(i-w)
    if i+w < n:
      d.append(i+w)
    if i%w != 0:
      d.append(i-1)
    if (i+1)%w != 0:
      d.append(i+1)
    for e in d:
      try:
        if raw[e] == 0:
          wf[i][e] = 1
      except:
        print(e)
#for x in wf:
  #print(x)
for k in range(n):
  for i in range(n):
    for j in range(n):
      if wf[i][k] + wf[k][j] < wf[i][j]:
        wf[i][j] = wf[i][k] + wf[k][j]
ans = 0
for i in range(n):
  for j in range(n):
    if ans < wf[i][j] % 100:
      ans = wf[i][j]
print(ans)
#for x in wf:
  #print(x)

### FIXED CODE ###

h,w = map(int,input().split())
n = h * w
raw = []
for i in range(h):
  tmp = input()
  add = []
  for j in range(w):
    if tmp[j] == '.':
      add.append(0)
    else:
      add.append(1)
  raw += add
wf = [[1000 for _ in range(n)] for _ in range(n)]
for i in range(n):
  if raw[i] == 0:
    wf[i][i] = 0
    d = []
    if i-w >= 0:
      d.append(i-w)
    if i+w < n:
      d.append(i+w)
    if i%w != 0:
      d.append(i-1)
    if (i+1)%w != 0:
      d.append(i+1)
    for e in d:
      if raw[e] == 0:
        wf[i][e] = 1
#for x in wf:
  #print(x)
for k in range(n):
  for i in range(n):
    for j in range(n):
      if wf[i][k] + wf[k][j] < wf[i][j]:
        wf[i][j] = wf[i][k] + wf[k][j]
ans = 0
for i in range(n):
  for j in range(n):
    if ans < wf[i][j] % 1000:
      ans = wf[i][j]
print(ans)
#for x in wf:
  #print(x)
### BUGGY CODE ###

n = int(input())
l = []
for i in range(1, n + 1):
    if n % i == 0:
        if i ** 2 > n:
            break
        j = n // i
        l.append(i + j)

print(min(l) - 2)

### FIXED CODE ###

n = int(input())
l = []
for i in range(1, int(n ** 0.5 + 1)):
    if n % i == 0:
        j = n // i
        l.append(i + j)

print(min(l) - 2)
### BUGGY CODE ###

n, m = map(int, input().split())
d = [[float("inf")] * n for i in range(n)]
edge = []
for i in range(m):
    a, b = map(int, input().split())
    edge.append((a, b))
    d[a - 1][b - 1] = 1
    d[b - 1][a - 1] = 1
ans = 0
for a in range(m):
    d_s = [x[:] for x in d]
    x, y = edge[a]
    d_s[x - 1][y - 1] = float("inf")
    d_s[y - 1][x - 1] = float("inf")
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d_s[i][j] = min(d_s[i][j], d_s[i][k] + d_s[k][j])
    flag = 0
    for i in range(n):
        if flag:
            break
        for j in range(n):
            if flag:
                break
            if d_s[i][j] == float("inf"):
                ans += 1
                flag = 1
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
d = [[float("inf")] * n for i in range(n)]
edge = []
for i in range(m):
    a, b = map(int, input().split())
    edge.append((a, b))
    d[a - 1][b - 1] = 1
    d[b - 1][a - 1] = 1
ans = 0
for a in range(m):
    d_s = [x[:] for x in d]
    x, y = edge[a]
    d_s[x - 1][y - 1] = float("inf")
    d_s[y - 1][x - 1] = float("inf")
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d_s[i][j] = min(d_s[i][j], d_s[i][k] + d_s[k][j])
    flag = 0
    for i in range(n):
        if flag:
            break
        for j in range(n):
            if flag:
                break
            if d_s[i][j] == float("inf"):
                ans += 1
                flag = 1
print(ans)
### BUGGY CODE ###

#coding:utf-8
def dbg(*something):
    if DEBUG:
        print(*something)






#正の宝石を戻すことはない
#負の宝石を戻すのは後半
from sys import stdin
from math import ceil,floor
DEBUG = False
N,K = list(map(int,stdin.readline().split()))
V = list(map(int,stdin.readline().split()))


#残りk回のとき深さk以下の場所に正の宝石がない→終了
#i回の操作で取れる石>それまでにとるi-1個の石の和
#深さiにある石vの価値：v - (それまでにとるi-1個の石の和　except (k-i)個の負の石)
'''
'''




def tansaku(left,right,rK,N,score):
    dbg(V[left:right+1],rK,N,score)


    max_v = score + sum(sorted(N)[rK:])


    # n = []
    for i in range(left,min(rK+left, ceil((right - left +1)/2)+left)):
        
        if V[i] <= 0:
            #n.append(V[i])
            continue

        #next_V = V[i+1:left+lenV]
        next_rK = rK - 1 - (i - left)
        next_tmp_v = tansaku(i+1,right,  next_rK, N+V[left:i], score+V[i])
        max_v = max(next_tmp_v , max_v)


        break

    # n = []
    for i in range(right ,max(right - ceil((right-left+1)/2)  ,right-rK)  ,-1 ):
        
        if V[i] <= 0:
            #n.append(V[i])
            continue

        #next_V = V[:i]
        next_rK = rK - 1 - (right - i)
        #next_tmp_v = tansaku(   left,   i- left -1  ,next_rK,N+n,score+V[i])
        next_tmp_v = tansaku(   left,   i-1  ,next_rK,N+V[i+1:right+1],score+V[i])
        max_v = max(next_tmp_v , max_v)
        break


    return max_v

print(tansaku(0,len(V)-1,K,[],0))






### FIXED CODE ###

#coding:utf-8



def main():
    
    def dbg(*something):
        if DEBUG:
            print(*something)


    #正の宝石を戻すことはない
    #負の宝石を戻すのは後半
    from sys import stdin
    from math import ceil,floor
    DEBUG = False
    N,K = list(map(int,stdin.readline().split()))
    V = list(map(int,stdin.readline().split()))
    
    max_value = 0
    dbg([i for i in range(3,-1,-1)])
    for getnum in range(1,min(N+1,K+1)):  #取る宝石の総数
        for a in range(getnum + 1):  #左から石を取る回数
            J = [0] * getnum #石
            b = getnum - a #右から石を取る回数
            for i in range(a):
                J[i] = V[i]
            for i in range(b):
                J[a+i] = V[-i-1]
            J.sort()
            #dbg(J,a,b)
            t = min(K-getnum,getnum) #捨てる石
           
            for i in range(t): 
                if J[i] >= 0:
                    t = i
                    break
            #dbg(J,i,t,a,b,J[t:])
            tmp_max = sum(J[t:])

            max_value = max(max_value,tmp_max)
    print(max_value)



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

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

# Nの因数を昇順で返す関数。1含む
def factor(n):
    f = []
    for i in range(1, int(n**0.5) + 1):
        if n%i == 0:
            f.append(i)
            if i != n//i:
                f.append(n//i)
    return f

if N == 1:
    print(P)
else:
    ans = 1
    for x in factor(P):
        if P % x**N == 0:
            ans = max(ans, x)
    print(ans)

### FIXED CODE ###

from collections import Counter

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

# n以下の全ての素数のセットを返す関数
def prime_set(n):
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5) + 1):
        primes.difference_update(range(i*2, n+1, i))
    return primes

# nを素因数分解して素因数の全リストを返す関数
def prime_factors(n):
    f = []
    for i in prime_set(int(n**0.5) + 1):
        while n % i == 0:
            f.append(i)
            n //= i
    if n > 1:
        f.append(n)
    return f

c = Counter(prime_factors(P))
ans = 1

for x in c.keys():
    ans *= pow(x, int(c[x]//N))

print(ans)
### BUGGY CODE ###

N, K, L = map(int, input().split())

class UnionFind(object):
    def __init__(self, N):
        self.parent = [-1] * N

    def root(self, A):
        if self.parent[A-1] < 0:
            return A
        self.parent[A-1] = self.root(self.parent[A-1])
        return self.parent[A-1]

    def size(self, A):
        if self.parent[A-1] < 0:
            return -1 * self.parent[A-1]
        return -1 * self.parent[self.root(A)-1]

    def connect(self, A, B):
        A = self.root(A)
        B = self.root(B)
        if A == B:
            return False
        
        if self.size(A) < self.size(B):
            A, B = B, A
        
        self.parent[A-1] += self.parent[B-1]
        self.parent[B-1] = A
        return True
        
uni1 = UnionFind(N)
for _ in range(K):
    p, q = map(int, input().split())
    if uni1.root(p) != uni1.root(q):
        uni1.connect(p,q)

uni2 = UnionFind(N)
for _ in range(L):
    r, s = map(int, input().split())
    if uni2.root(r) != uni2.root(s):
        uni2.connect(r,s)

# print (uni1.parent)
# print (uni2.parent)
for i in range(1, N+1):
    ans = 0
    for j in range(1, N+1):
        # print (uni1.root(i), uni1.root(j), uni2.root(i), uni2.root(j))
        if uni1.root(i) == uni1.root(j) and uni2.root(i) == uni2.root(j):
            ans += 1
    print (ans, end = ' ')
print ()

# print (uni1.parent)
# print (uni2.parent)


### FIXED CODE ###

N, K, L = map(int, input().split())

class UnionFind(object):
    def __init__(self, N):
        self.parent = [i for i in range(N)]

    def root(self, A):
        if self.parent[A] == A:
            return A
        self.parent[A] = self.root(self.parent[A]) #経路縮約
        return self.parent[A]

    def connect(self, A, B):
        A = self.root(A)
        B = self.root(B)
        self.parent[A] = B
        
uni1 = UnionFind(N)
for _ in range(K):
    p, q = map(int, input().split())
    if uni1.root(p-1) != uni1.root(q-1):
        uni1.connect(p-1,q-1)

uni2 = UnionFind(N)
for _ in range(L):
    r, s = map(int, input().split())
    if uni2.root(r-1) != uni2.root(s-1):
        uni2.connect(r-1,s-1)

# print (uni1.parent)
# print (uni2.parent)

ans = dict()
key_list = []
for i in range(N):
    root1 = uni1.root(i)
    root2 = uni2.root(i)
    key = str(root1) + '_' + str(root2)
    key_list += [key]
    if key in ans.keys():
        ans[key] += 1
    else:
        ans[key] = 1
    
for i in range(N):
    print (ans[key_list[i]], end = ' ')
print ()






# for i in range(1, N+1):
#     ans = 0
#     for j in range(1, N+1):
#         # print (uni1.root(i), uni1.root(j), uni2.root(i), uni2.root(j))
#         if uni1.root(i) == uni1.root(j) and uni2.root(i) == uni2.root(j):
#             ans += 1
#     print (ans, end = ' ')
print ()

# print (uni1.parent)
# print (uni2.parent)
### BUGGY CODE ###

N = int(input())
A = [int(x) for x in input().split()]
B = list()
cut = 0
trend = ""

for i in range(N):
	B.append(A[i])
	if len(B) == 2 or trend == "neutral":
		if min(B) == max(B):
			trend = "neutral"
		elif B == sorted(B):
			trend = "up"
		elif B == sorted(B, reverse = True):
			trend = "down"
	elif len(B) > 2:
		if trend == "up" and A[i] != max(B):
			cut += 1
			B = [A[i]]
		elif trend == "down" and A[i] != min(B):
			cut += 1
			B = [A[i]]
print(cut + 1)


### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]
B = list()
cut = 0
trend = ""

for i in range(N):
	B.append(A[i])
	if len(B) == 2 or trend == "neutral":
		if min(B) == max(B):
			trend = "neutral"
		elif A[i] == max(B):
			trend = "up"
		elif A[i] == min(B):
			trend = "down"
	elif len(B) > 2:
		if trend == "up" and A[i] < B[-2]:
			cut += 1
			B = [A[i]]
		elif trend == "down" and A[i] > B[-2]:
			cut += 1
			B = [A[i]]
print(cut + 1)
### BUGGY CODE ###

DEBUG = False


def get_pos(index):
    """初期位置indexのロボットのクエリ後の配置を返す
    is_whick_sideの返り値として返す"""
    if DEBUG: print()
    iws = is_whick_side(index)
    if iws != 0:
        if DEBUG: print(iws)
        return iws
    for t, d in e:
        if DEBUG: print(index, s[index], t, d, end='')
        if t == s[index]:
            if d == 'R':
                index += 1
            else:
                index -= 1
        if DEBUG: print('->', index, s[index] if 0 <= index < N else '==Removed')
        iws = is_whick_side(index)
        if iws != 0:
            if DEBUG: print(iws)
            return iws
    if DEBUG: print(0)
    return 0


def is_whick_side(index):
    if index == -1:
        return -1
        # 左消滅
    elif index == N:
        return 1
        # 右消滅
    else:
        return 0
        # 非消滅
    # 二分探索中に左右どちらから消滅したか把握しておかないと
    # midの初期値が消滅だった場合に
    # indexの-1側,N側どちら側に次の探索範囲を設ければよいのか判断できない


N, Q = map(int, input().split())
s = input()

e = [input().split() for _ in range(Q)]
# t: 文字 <- siと比較
# d: 'L', 'R'

# right
left = -1
right = N
while right - left > 1:
    mid = (left + right) // 2
    if get_pos(mid) == 1:
        # 右消滅
        right = mid
    else:
        left = mid
    if DEBUG: print('lr', left, right)
ar = right
if DEBUG: print('right', ar)
# 右消滅開始位置

# left
left = -1
right = N
while right - left > 1:
    mid = (left + right) // 2
    if get_pos(mid) == -1:
        left = mid
    else:
        right = mid
    if DEBUG: print('lr', left, right)
al = left
if DEBUG: print('left', al)
# 左消滅開始位置
# (al, ar) = 残存区間

print((ar - 1) - (al + 1) + 1)


### FIXED CODE ###

"""https://atcoder.jp/contests/exawizards2019/submissions/4769434
左右どちらから消滅するか確認が必要だと気づかされた"""


def get_pos(index):
    """初期位置indexのロボットのクエリ後の配置を返す
    is_whick_sideの返り値として返す"""
    iws = -1 if index == -1 else 1 if index == N else 0
    if iws != 0:
        return iws
    for t, d in e:
        if t == s[index]:
            if d == 'R':
                index += 1
            else:
                index -= 1
        iws = -1 if index == -1 else 1 if index == N else 0
        if iws != 0:
            return iws
    return 0


N, Q = map(int, input().split())
s = input()

e = [input().split() for _ in range(Q)]
# t: 文字 <- siと比較
# d: 'L', 'R'

# right
left = -1
right = N
while right - left > 1:
    mid = (left + right) // 2
    if get_pos(mid) == 1:
        # 右消滅
        right = mid
    else:
        left = mid
ar = right
# 右消滅開始位置

# left
left = -1
right = N
while right - left > 1:
    mid = (left + right) // 2
    if get_pos(mid) == -1:
        left = mid
    else:
        right = mid
al = left
# 左消滅開始位置
# (al, ar) = 残存区間

print((ar - 1) - (al + 1) + 1)
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
def abs(x):
    if x>=0:
        return x
    else:
        return x*(-1)
B=[0]*N
for j in range(N):
    B[j]=A[j]-j-1
max=B[0]
min=B[0]
for k in range(len(B)):
  if max<=B[k]:
    max=B[k]
bt=max
for k in range(len(B)):
  if min>=B[k]:
    min=B[k]
bh=min
def sad(A,b):
  s=[0]*(len(A))
  for m in range(len(A)):
    s[m]=abs(A[m]-(b+m+1))
  return s
def sum(A):
  sum=0
  for n in range(len(A)):
    sum=sum+A[n]
  return sum
l=[]
for o in range(bh-5,bt+5):
  l.append(sum(sad(A,o)))
mini=l[0]
for p in range(bt-bh+10):
  if mini>=l[p]:
    mini=l[p]
print(mini)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(N):
  B.append(A[i]-i-1)
B.sort()
if N%2==0:
  b=(B[N//2]+B[N//2-1])//2
else:
  b=B[N//2]
sad=0
for j in range(N):
  sad=sad+abs(B[j]-b)
print(sad)
### BUGGY CODE ###

n, x = map(int, input().split())
import numpy as np


def burger(num):
    if num == 1:
        return np.array([1, 3, 1])
    last_burger = burger(num - 1)
    return np.concatenate((last_burger[0] + 1, last_burger[1:], 1, last_burger[:-1], last_burger[-1] + 1), axis=None)


def main(n, x):
    burger_n = burger(n)

    i, p, eaten = 0, 0, 0

    while eaten < x:
        eaten += burger_n[i]
        if i % 2 == 1:
            p += burger_n[i]
        i += 1

    if i % 2 == 0:
        p -= (eaten - x)

    print(p)


main(n, x)

### FIXED CODE ###

n, x = map(int, input().split())
x -= 1


def main(n, x):
    if n == 0:
        if x >= 0:
            return 1
        else:
            return 0
    if x == 0:
        return 0
    if x == 2 ** (n + 1) - 2:
        return 2 ** n
    if x < 2 ** (n + 1) - 2:
        return main(n - 1, x - 1)
    return 2 ** n + main(n - 1, x - (2 ** (n + 1) - 1))


print(main(n, x))
### BUGGY CODE ###

c=input().split(" ")

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

for i in range(1,a*b+1):
    if i%a==0 and i%b==0:
        print(i)
        break


### FIXED CODE ###

def gcd(a,b):
    if a==0 or b==0:
        return max([a,b])
    else:
        if a>=b:
            n=int(a/b)
            return gcd(a-n*b,b)
        else:
            n=int(b/a)
            return gcd(a,b-n*a)

def lcm(a,b):
   return int(a*b/gcd(a,b)) 
a=input().split(" ")
print(lcm(int(a[0]),int(a[1])))
### BUGGY CODE ###

import sys
import bisect

sys.setrecursionlimit(10 ** 7)


N = int(input())

A = list(map(int, input().split()))
T = [[] for _ in range(N)]
for i in range(N - 1):
    a, b = map(int, input().split())
    T[a - 1].append(b - 1)
    T[b - 1].append(a - 1)

F = [[] for _ in range(N)]


def dfs(s):
    for d in T[s]:
        if not F[d]:
            F[d] = F[s][:]
            t = bisect.bisect_left(F[d], A[d])
            if t == len(F[d]):
                F[d].append(A[d])
            else:
                F[d][t] = A[d]
            dfs(d)


F[0] = [A[0]]
dfs(0)

for f in F:
    print(len(f))


### FIXED CODE ###

import sys
import bisect

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

N = int(input())

A = list(map(int, input().split()))
T = [[] for _ in range(N)]
for i in range(N - 1):
    a, b = map(int, input().split())
    T[a - 1].append(b - 1)
    T[b - 1].append(a - 1)

F = [-1 for _ in range(N)]
F[0] = 1
INF = 10 ** 9
dp = [INF for _ in range(N + 1)]
dp[0] = A[0]


def dfs(s):
    for d in T[s]:
        if F[d] == -1:
            t = bisect.bisect_left(dp, A[d])
            p = dp[t]
            dp[t] = A[d]
            F[d] = bisect.bisect_left(dp, INF)
            dfs(d)
            dp[t] = p


dfs(0)

print("\n".join(map(str, F)))
### BUGGY CODE ###

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

#n=4
#a=8
#x=[7,9,8,9]

#n=8
#a=5
#x=[3,6,2,8,7,6,5,9]

for i in range(n):
    x[i]=x[i]-a
    
n2=n//2
n3=n-n2

y=[]
for i in range(n3):
    y.append(x[i+n2])

# itertools 使用 bit全探索
import itertools

xsum=dict()
for i in itertools.product([0,1], repeat=n2):
    isum=0
    for ii in range(n2):
        if i[ii]==0:
            isum=isum+x[ii]
    if isum in xsum:
        xsum[isum]=xsum[isum]+1
    else:
        xsum[isum]=1
xsum[0]=xsum[0]-1*0
#print(xsum)        
    
icnt=0
for i in itertools.product([0,1], repeat=n3):
    isum=0
    for ii in range(n3):
        if i[ii]==0:
            isum=isum+y[ii]
#    print(isum)
    for xs in xsum.items():
        if xs[0]==-isum:
            icnt=icnt+(xs[1])
#            print(isum,xs[1],(xs[1]),icnt)

print(icnt-1)

### FIXED CODE ###

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

for i in range(n):
    x[i]=x[i]-a
    
nx=n*n
dp=[[0]*(2*nx+1) for i in range(n+1)]

#print(dp)

dp[0][nx]=1

for j in range(1,n+1):
    jj=j-1
    for t in range(2*nx+1):
        if t-x[jj]<0 or 2*nx<t-x[jj]:
            dp[j][t]=dp[j-1][t]
        elif 0<t-x[jj] and  t-x[jj]<2*nx:
            dp[j][t]=dp[j-1][t]+dp[j-1][t-x[jj]]
        else:
            dp[j][t]=0

print(dp[n][nx]-1)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
 
ans = 0
for i in range(0,N):
  
  for j in range(0,i):
    
    ans = (ans + (A[i] * A[j])%(10**9+7))%(10**9+7)
 
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
 
ans = 0
sum = 0
for i in range(1,N):
  
  sum = sum + A[i-1]
  ans = (ans + sum*A[i])%(10**9+7)
  
print(ans)
### BUGGY CODE ###

n = int(input())
ws = []
for _ in range(n):
    ws.append(input())

dics = []
for w in ws:
    d = {}
    for c in w:
        if c in d.keys():
            d[c] += 1
        else:
            d[c] = 1
    dics.append(d)

r = 0
for i in range(n):
    for j in range(n):
        if j <= i:
            continue
        if dics[i] == dics[j]:
            r += 1

print(r)


### FIXED CODE ###

n = int(input())
ws = [list(input()) for _ in range(n)]

def sort_l(l):
    l.sort()
    return l
ws = list(map(sort_l, ws))
ws.sort()

i = 0
j = 0
r = 0
ans = 0
while(i<n-1):
    i += 1
    if ws[i] == ws[j]:
        r += 1
    else:
        ans += r * (r+1) // 2
        r = 0
        j = i
ans += r * (r+1) // 2

print(ans)
### BUGGY CODE ###

n = int(input())
*A, = map(int, input().split())
a, b, c = A.count(1), A.count(2), A.count(3)
DP = [[[0.0 for k in range(n+1)] for j in range(n+1)] for i in range(n+1)]
for k in range(n+1):
    for j in range(n+1):
        for i in range(n+1):
            if i+j+k == 0:
                continue
            tmp = n
            if i > 0:
                tmp += DP[i-1][j][k]*i
            if j > 0 and i < n:
                tmp += DP[i+1][j-1][k]*j
            if k > 0 and j < n:
                tmp += DP[i][j+1][k-1]*k
            DP[i][j][k] = tmp/(i+j+k)
print(DP[a][b][c])


### FIXED CODE ###

n = int(input())
*A, = map(int, input().split())
a, b, c = A.count(1), A.count(2), A.count(3)
DP = [[[0.0 for k in range(n+1)] for j in range(n+1)] for i in range(n+1)]
for k in range(c+1):
    for j in range(b+c-k+1):
        for i in range(n-j-k+1):
            if i+j+k == 0:
                continue
            tmp = n
            if i > 0:
                tmp += DP[i-1][j][k]*i
            if j > 0:
                tmp += DP[i+1][j-1][k]*j
            if k > 0:
                tmp += DP[i][j+1][k-1]*k
            DP[i][j][k] = tmp/(i+j+k)
print(DP[a][b][c])
### BUGGY CODE ###

n=int(input())
A=[int(input()) for i in range(n)]
ans=set()
for i in range(n):
    ans=ans^set([A[i]])
print(len(ans))

### FIXED CODE ###

N=int(input())
s=set()
for i in range(N):s^={input()}
print(len(s))
### BUGGY CODE ###

n = int(input())
a = [int(x) for x in input().split()]

def is_satisfied(s):
    ln = len(s)
    for i in range(ln - 1, 1, -2):
        if not s.count(i) == 2:
            return False
    if ln % 2 == 0:
        if not s.count(1) == 2:
            return False
    else:
        if not s.count(0) == 1:
            return False

    return True


ans = 2 ** (n // 2) % (10 ** 9 + 7)
print(ans if is_satisfied(a) else 0)


### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]

def is_satisfied(s):
    ln = len(s)
    check = sorted(list(range(ln - 1, 1, -2)) * 2)
    if ln % 2 == 0:
        check.insert(0, 1)
        check.insert(0, 1)
    else:
        check.insert(0, 0)

    return sorted(s) == check

    # for i in range(ln - 1, 1, -2):
    #     if not s.count(i) == 2:
    #         return False
    # if ln % 2 == 0:
    #     if not s.count(1) == 2:
    #         return False
    # else:
    #     if not s.count(0) == 1:
    #         return False

    # return True


ans = 2 ** (n // 2) % (10 ** 9 + 7)
print(ans if is_satisfied(a) else 0)
### BUGGY CODE ###

# D - FT Robot
# coding: utf-8

def check(d, to_d):
  meu = [0]
  for i in to_d:
    hoge = []
    for j in meu:
      if not j+i in hoge : hoge.append(j+i) 
      if not j-i in hoge : hoge.append(j-i)
    meu = hoge
  return d in meu

S = [ len(F) for F in raw_input().split('T') ]
x, y = map(int, raw_input().split())
to_x, to_y = S[2::2], S[1::2]

print "Yes" if check(x-S[0],to_x) and check(y,to_y) else "No"

### FIXED CODE ###

# D - FT Robot
# coding: utf-8

def check(d, to_d):
  meu = set([0])
  for i in to_d:
    hoge = set([])
    for j in meu: hoge.add(j+i), hoge.add(j-i)
    meu = hoge
  return d in meu

S = map(len, raw_input().split('T'))
x, y = map(int, raw_input().split())
to_x, to_y = S[2::2], S[1::2]

print "Yes" if check(x-S[0],to_x) and check(y,to_y) else "No"
### BUGGY CODE ###

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

for _ in range(M):
    n = max(lst)
    idx = lst.index(n)
    lst[idx] = n // 2
print(sum(lst))

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
lst = [int(x) * -1 for x in input().split()]
heapq.heapify(lst)
for _ in range(M):
    n = heapq.heappop(lst)
    n = n * -1 // 2 * -1
    heapq.heappush(lst, n)
print(sum(lst) * -1)