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

H,W,K = map(int,input().split())
S = [list(map(int,input())) for _ in [0]*H]

ans = H*W
S2 = [[0]*(W+1) for _ in [0]*(H+1)]
for i in range(H):
    for j in range(W):
        S2[i+1][j+1] = S2[i][j+1] + S[i][j]
for i in range(1,H+1):
    for j in range(W):
        S2[i][j+1] += S2[i][j]

for i in range(1<<(H-1)):
    check = [0]+[j+1 for j in range(H-1) if i>>j&1]+[H]
    cnt = len(check)-2
    l = 0
    r = 1
    while r<=W:
        for j,k in zip(check[:-1],check[1:]):
            if S2[j][l] + S2[k][r] - S2[j][r] - S2[k][l] > K:
                cnt += 1
                l = r-1
                r = r
                break
        else:
            r += 1
    ans = min(ans,cnt)
print(ans)

### FIXED CODE ###

H,W,K = map(int,input().split())
S = [list(map(int,input())) for _ in [0]*H]

ans = H*W
S2 = [[0]*(W+1) for _ in [0]*(H+1)]
for i in range(H):
    for j in range(W):
        S2[i+1][j+1] = S2[i][j+1] + S[i][j]
for i in range(1,H+1):
    for j in range(W):
        S2[i][j+1] += S2[i][j]

for i in range(1<<(H-1)):
    check = [0]+[j+1 for j in range(H-1) if i>>j&1]+[H]
    cnt = len(check)-2
    l = 0
    r = 1
    while r<=W:
        for j,k in zip(check[:-1],check[1:]):
            if S2[j][l] + S2[k][r] - S2[j][r] - S2[k][l] > K:
                if r==l+1:
                    cnt += H*W
                    r = W+1
                    break
                cnt += 1
                l = r-1
                r = r
                break
        else:
            r += 1
    ans = min(ans,cnt)
print(ans)
### BUGGY CODE ###

import itertools

n, m = map(int, input().split())
ab_list = [list(map(int, input().split())) for _ in range(n)]
ab_list.sort(key=lambda i: (i[0]))

l = []
ans = 0
d = {key: list(val) for key, val in itertools.groupby(ab_list, key=lambda i: i[0])}
for i in range(1, m + 1):
    if i in d:
        l += [b for _, b in d[i]]
        l.sort()
    if len(l) > 0:
        m = l.pop()
        ans += m
print(ans)


### FIXED CODE ###

from heapq import heappush, heappop

n, m = map(int, input().split())
d = dict()
for _ in range(n):
    a, b = map(int, input().split())
    d.setdefault(a, [])
    d[a].append(-b)

h = []
ans = 0
for i in range(1, m + 1):
    for b in d.get(i, []):
        heappush(h, b)
    if len(h) > 0:
        m = heappop(h)
        ans -= m
print(ans)
### BUGGY CODE ###

mod = 10 ** 9 + 7

S = input()
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1

for i in range(len(S)):
    x = S[-(i + 1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i + 1][(k * (10**i) + j) % 13] += dp[i][j]
                dp[i + 1][(k * (10**i) + j) % 13] %= mod
    else:
        k = int(x)
        for j in range(13):
            dp[i + 1][(k * (10**i) + j) % 13] += dp[i][j]
            dp[i + 1][(k * (10**i) + j) % 13] %= mod
    #mul = mul * 10 % 13

print(dp[len(S)][5])


### FIXED CODE ###

mod = 10 ** 9 + 7

S = input()
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1

for i in range(len(S)):
    x = S[-(i + 1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i + 1][(mul * k + j) % 13] += dp[i][j]
                dp[i + 1][(mul * k + j) % 13] %= mod
    else:
        k = int(x)
        for j in range(13):
            dp[i + 1][(mul * k + j) % 13] += dp[i][j]
            dp[i + 1][(mul * k + j) % 13] %= mod
    mul = mul * 10 % 13

print(dp[len(S)][5])
### BUGGY CODE ###

from bisect import bisect_right

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

a.sort()
b.sort()
c.sort()

# print(a, b, c)

ans = 0
for i in range(n):
    idx_b = bisect_right(b, a[i])
    # select_b = n - idx_b
    for j in range(idx_b, n):
        idx_c = bisect_right(c, b[j])
        select_c = n - idx_c
        ans += select_c
print(ans)



### FIXED CODE ###

from bisect import bisect_left, bisect_right

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

a.sort()
b.sort()
c.sort()

# print(a, b, c)

ans = 0

for i in range(n):
    idx_a = bisect_left(a, b[i])
    select_b = idx_a

    idx_c = bisect_right(c, b[i])
    select_c = n - idx_c
    ans += select_b * select_c

# for i in range(n):
#     idx_b = bisect_right(b, a[i])
#     # select_b = n - idx_b
#     for j in range(idx_b, n):
#         idx_c = bisect_right(c, b[j])
#         select_c = n - idx_c
#         ans += select_c
print(ans)
### BUGGY CODE ###

# import pdb
n = int(raw_input())

list = []
for x in xrange(n):
  list.append(int(raw_input()))

max = -10000000000000
for x in xrange(0, n - 1):
  for y in xrange(x + 1, n):
    # pdb.set_trace()
    temp = list[y] - list[x]
    if temp > max:
      max = temp

print max

### FIXED CODE ###

n = int(raw_input())
num_list = [int(raw_input()) for i in xrange(n)]

minv = num_list[0]
maxv = -1000000000

for i in xrange(1, n):
  tmp = num_list[i] - minv
  maxv = tmp if tmp > maxv else maxv
  minv = num_list[i] if minv > num_list[i] else minv
  # print "i = %d, tmp = %d, maxv = %d, minv = %d" % (i, tmp, maxv, minv)

print maxv
### BUGGY CODE ###

from fractions import gcd
MOD=(10**9)+7
n=int(input())
a=list(map(int,input().split()))
a_lcm=a[0]

for ai in a:
    a_lcm=(a_lcm*ai) // gcd(a_lcm, ai)

b=[]
for ai in a:
    b.append(a_lcm//ai)
sum_b=sum(b)
print(sum_b%MOD)

### FIXED CODE ###

from fractions import gcd
MOD=(10**9)+7
n=int(input())
a=list(map(int,input().split()))
a_lcm=a[-1]

for ai in a:
    a_lcm=(a_lcm*ai) // gcd(a_lcm, ai)

sum_b=0
for ai in a:
    bi=a_lcm//ai
    sum_b+=bi
print(sum_b%MOD)
### BUGGY CODE ###

#https://tjkendev.github.io/procon-library/python/string/rolling_hash.html
class RollingHash():
    def __init__(self, s, base, mod):
        self.mod = mod
        self.pw = pw = [1]*(len(s)+1)
 
        l = len(s)
        self.h = h = [0]*(l+1)
 
        v = 0
        for i in range(l):
            h[i+1] = v = (v * base + ord(s[i])) % mod
        v = 1
        for i in range(l):
            pw[i+1] = v = v * base % mod
    def get(self, l, r):
        return (self.h[r] - self.h[l] * self.pw[r-l]) % self.mod
N=int(input())
S=input()
R1=RollingHash(S,37,10**9+7)
R2=RollingHash(S,29,10**9+9)
ans=0
for ln in range(1,N//2+1):
    D=dict()
    for l in range(N-ln+1):
        tmp=(R1.get(l,l+ln),R2.get(l,l+ln))
        if not(tmp in D):
            D[tmp]=[l,l]
        D[tmp][1]=max(D[tmp][1],l)
        D[tmp][0]=min(D[tmp][0],l)
    #print(ln,D)
    for k in D:
        if D[k][1]-D[k][0]>=ln:
            ans=max(ans,ln)
print(ans)

### FIXED CODE ###

#https://tjkendev.github.io/procon-library/python/string/rolling_hash.html
class RollingHash():
    def __init__(self, s, base, mod):
        self.mod = mod
        self.pw = pw = [1]*(len(s)+1)
 
        l = len(s)
        self.h = h = [0]*(l+1)
 
        v = 0
        for i in range(l):
            h[i+1] = v = (v * base + ord(s[i])) % mod
        v = 1
        for i in range(l):
            pw[i+1] = v = v * base % mod
    def get(self, l, r):
        return (self.h[r] - self.h[l] * self.pw[r-l]) % self.mod
N=int(input())
S=input()
R1=RollingHash(S,37,10**9+7)
R2=RollingHash(S,29,10**9+9)
ans=0
for ln in range(1,N//2+1):
    D=dict()
    for l in range(N-ln+1):
        tmp=(R1.get(l,l+ln),R2.get(l,l+ln))
        if tmp in D:
            if D[tmp]+ln<=l:
                ans=max(ln,ans)
        else:
            D[tmp]=l
print(ans)
### BUGGY CODE ###

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

n = N
while True:
    if sum(A[:n]) <= K:
        break
    n -= 1

m = M
cost = []
for n in range(n + 1):
    #print(n, m)
    if sum(A[:n]) > K:
        break
    while True:
        #print(n, m)
        if sum(A[:n]) + sum(B[:m]) <= K:
            cost.append(n + m)
            break
        m -= 1
# print(cost)
print(max(cost))


### FIXED CODE ###

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

ma = [0] * (N + 1)
mb = [0]*(M+1)


for i in range(N):
    ma[i + 1] = ma[i] + A[i]

for i in range(M):
    mb[i + 1] = mb[i] + B[i]

j = M
max_num = 0

for i in range(N+1):
    if ma[i] > K:
        break
    while ma[i] + mb[j] > K:
        j -= 1
    max_num = max(max_num, i + j)
print(max_num)
### BUGGY CODE ###

from sys import stdin
def input():
    return stdin.readline().strip()

# 8! = 40320

n, m, r = map(int, input().split())
l = list(map(int, input().split()))
for i in range(r):
    l[i] -= 1
edge = [[] for _ in range(n)]
weight = [[] for _ in range(n)]
for _ in range(m):
    i, j, k = map(int, input().split())
    i -= 1
    j -= 1
    edge[i].append(j)
    edge[j].append(i)
    weight[i].append(k)
    weight[j].append(k)

# dijkstra
from heapq import heapify, heappush, heappop

distance = [[-1] * n for _ in range(n)]
for start in range(n):
    todo = [(0, start)]
    heapify(todo)

    while len(todo) > 0:
        cost, node = heappop(todo)
        if distance[start][node] == -1:
            distance[start][node] = cost

            for i in range(len(edge[node])):
                if distance[start][edge[node][i]] == -1:
                    heappush(todo, (cost + weight[node][i], edge[node][i]))

# full search
from itertools import permutations

answer = float('inf')
for i in permutations(l):
    ans = 0
    for j in range(r-1):
        ans += distance[i[j]][i[j+1]]
    if ans < answer:
        answer = ans

print(answer)

### FIXED CODE ###

def main():
    from sys import stdin
    input = stdin.readline

    n, m, r = map(int, input().split())
    l = list(map(int, input().split()))
    for i in range(r):
        l[i] -= 1
    d = [[float('inf')] * n for _ in range(n)]
    for _ in range(m):
        i, j, k = map(int, input().split())
        d[i-1][j-1] = k
        d[j-1][i-1] = k

    # Warshall-Floyd algorithm
    for k in range(n):
        for i in range(n):
            for j in range(n):
                if d[i][j] > d[i][k] + d[k][j]:
                    d[i][j] = d[i][k] + d[k][j]

    # full search
    # 8! = 40320
    from itertools import permutations

    answer = float('inf')
    for i in permutations(l):
        ans = 0
        for j in range(r-1):
            ans += d[i[j]][i[j+1]]
        if ans < answer:
            answer = ans

    print(answer)

main()
### BUGGY CODE ###

import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
from collections import defaultdict
import itertools
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

N, = map(int, input().split())
L = []
for i in range(N):
    c = int(input())
    a = [[int(v) for v in input().split()] for _ in range(c)]
    L.append(a)

def dfs(index, al):
    for v in L[index]:
        c = v[0] - 1
        if c not in al:
            if v[1]:
                al = dfs(c, al + [c])

    return al

t = [None] * N
for i in range(N):
    t[i] = dfs(i, [i])

ans = 0
for i in range(1 << N):
    a = set()
    for j in range(N):
        if (i >> j) & 1:
            a.add(j)

    for p in list(a):
        for v in t[p]:
            a.add(v)

    s = [-1] * N
    f = True

    for v in a:
        s[v] = 1

    for v in a:
        for x, y in L[v]:
            if s[x-1] == -1:
                s[x-1] = y
            elif s[x-1] != y:
                f = False
    if f:
        ans = max(ans, len(a))

print(ans)

### FIXED CODE ###

import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
from collections import defaultdict
import itertools
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

N, = map(int, input().split())
L = []
for i in range(N):
    c = int(input())
    a = [[int(v) for v in input().split()] for _ in range(c)]
    L.append(a)

def dfs(index, al):
    for v in L[index]:
        c = v[0] - 1
        if c not in al:
            if v[1]:
                al = dfs(c, al + [c])

    return al

t = [None] * N
for i in range(N):
    t[i] = dfs(i, [i])

ans = 0
for i in range(1 << N):
    a = set()
    for j in range(N):
        if (i >> j) & 1:
            a.add(j)

    for p in list(a):
        for v in t[p]:
            a.add(v)

    s = [-1] * N
    f = True

    for v in a:
        s[v] = 1

    for v in a:
        for x, y in L[v]:
            if s[x-1] == -1:
                s[x-1] = y
            elif s[x-1] != y:
                f = False
    if f:
        ans = max(ans, len(a))

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

import bisect
def solve(N, As):
    colors = []
    for a in As:
        if not colors:
            colors.append(a)
        else:
            if a <= colors[0]:
                colors.append(a)
            else:
                i = bisect.bisect_left(colors, a)
                colors[i-1] = a
        colors.sort()
    return len(colors)

if __name__ == "__main__":
    N = int(input())
    As = []
    [As.append(int(input())) for i in range(N)]
    print(solve(N, As))


### FIXED CODE ###


import bisect
from array import array


def slow_solve(N, As):
    colors = []
    for a in As:
        if not colors:
            colors.append(a)
        else:
            if a <= colors[0]:
                colors.append(a)
            else:
                i = bisect.bisect_left(colors, a)
                colors[i-1] = a
        colors.sort()
        print(colors)
    return len(colors)


def solve(N, As):
    colors = array('I', [])
    for a in As:
        if not colors:
            colors.append(a)
        else:
            if a <= colors[0]:
                colors.insert(0, a)
            else:
                i = bisect.bisect_left(colors, a)
                colors[i - 1] = a
                j = i - 1
                while j + 1 < len(colors) and colors[j] > colors[j + 1]:
                    colors[j], colors[j + 1] = colors[j + 1], colors[j]
                    j += 1
        # print(colors)
    return len(colors)

#
# for _ in range(100):
#     import random
#     N = 10
#     As = [random.randint(1, 10) for _ in range(5)]
#     if slow_solve(N, As) != solve(N, As):
#         print("OUT")
#         print(N)
#         print(As)
#         input()
# print("OK")

if __name__ == "__main__":
    N = int(input())
    As = []
    [As.append(int(input())) for i in range(N)]
    print(solve(N, As))
### BUGGY CODE ###

from collections import deque

n, m = map(int, input().split())
People = {x+1:[] for x in range(10**6+1)}

for _ in range(m):
    l, r, d = map(int, input().split())
    People[l].append([r, d])
    People[r].append([l, -d])

INF = 10**10
Visited = [INF for i in range(10**6+1)]

def bfs(v):
    dq = deque()
    dq.append(v)
    Visited[v] = 0
    check = True
    while dq:
        now = dq.popleft()
        Related = People[now]
        for related in Related:
            if Visited[related[0]] == INF:
                dq.append(related[0])
                Visited[related[0]] = Visited[now] + related[1]
            elif Visited[related[0]] != Visited[now] + related[1]:
                check = False
    return check

ans = 'Yes'
for i in range(1,10**6+1):
    if Visited[i] == INF:
        if bfs(i) == False:
            ans = 'No'

print(ans)



### FIXED CODE ###

from collections import deque

n, m = map(int, input().split())
People = {x+1:[] for x in range(10**6+1)}

for _ in range(m):
    l, r, d = map(int, input().split())
    People[l].append([r, d])
    People[r].append([l, -d])

INF = 10**10
Visited = [INF for i in range(10**6+1)]

def bfs(v):
    dq = deque()
    dq.append(v)
    Visited[v] = 0
    check = True
    while dq:
        now = dq.popleft()
        Related = People[now]
        for related in Related:
            if Visited[related[0]] == INF:
                dq.append(related[0])
                Visited[related[0]] = Visited[now] + related[1]
            elif Visited[related[0]] != Visited[now] + related[1]:
                check = False
    return check

ans = 'Yes'
for i in range(1,10**6+1):
    if Visited[i] == INF:
        if bfs(i) == False:
            ans = 'No'

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

import sys
N = int(input())
if N < 3 or 2 * (10**5) < N:
	print("error\nボールは3個以上200000以下")
	sys.exit()

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

set_lst = [x for x in set(A)]
nums_mutch = [0] * len(set_lst)
i = 0
while not i == len(set_lst):
	if set_lst[i] == 0:
		i += 1
		continue
	else:
		nums_mutch[i] =  A.count(set_lst[i])
		i += 1

all_flag = [int((x * (x - 1)) / 2) for x  in nums_mutch]
k = 0
while not k == N:
	klist = all_flag.copy()
	index_k = set_lst.index(A[k])
	kflag = nums_mutch[index_k] - 1
	klist[index_k] = int((kflag * (kflag - 1)) / 2)
	print(sum(klist))
	k += 1

### FIXED CODE ###

N=int(input())
A=list(input().split())
check=[0]*N
for i in range(N):
	check[int(A[i])-1]+=1
num=0
for i in range(N):
	num+=check[i]*(check[i]-1)//2
for i in range(N):
	if check[int(A[i])-1]!=2:
		print(num-(check[int(A[i])-1]-1))
	else:
		print(num-1)
### BUGGY CODE ###

n=int(input())
s=[input() for i in range(n)]

std=[]
for i in range(n):
    std.append(sorted(s[i]))

cnt=0
for i in range(n-1):
    for j in range(i+1,n):
        if std[i]==std[j]:
            cnt+=1

print(cnt)

### FIXED CODE ###

import math

n=int(input())
s=[input() for i in range(n)]

std=[]
for i in range(n):
    std.append(sorted(s[i]))
stdx=[]
stdx=sorted(std)

cnt=0
k=1
for i in range(n-1):
    if stdx[i]==stdx[i+1]:
        k+=1
        if k>1 and i==n-2:
            cnt+=math.factorial(k)//math.factorial(k-2)//math.factorial(2)
    else:
        if k>1:
            cnt+=math.factorial(k)//math.factorial(k-2)//math.factorial(2)
            k=1

print(cnt)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)

import sys
input = sys.stdin.readline

n = int(input())
al = list(map(int,input().split()))

from collections import defaultdict
G = defaultdict(list)

for _ in range(n-1):
    u,v = map(int,input().split())
    G[u-1].append(v-1)
    G[v-1].append(u-1)

from bisect import bisect
ansl = [0 for i in range(n)]
dp = [float("inf") for _ in range(n+1)]
dp[0] = -1
used = [0 for i in range(n)]
used[0] = 1


stack = []
def dfs(pos, dp):
    idx = bisect(dp, al[pos] - 1)
    stack.append((idx, dp[idx]))
    dp[idx] = min(al[pos], dp[idx])
    ansl[pos] = max(i for i in range(n+1) if dp[i] < float("inf"))
    for i in range(n):
        if dp[i] == "inf":
            ansl[pos] = i
            break
    for v in G[pos]:
        if used[v] == 0:
            used[v] = 1
            dfs(v, dp)
            idx, k = stack.pop()
            dp[idx] = k


dfs(0, dp)
flag = False
for i in range(n):
    print(ansl[i])




### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

import sys
input = sys.stdin.readline

n = int(input())
al = list(map(int,input().split()))

from collections import defaultdict
G = defaultdict(list)

for _ in range(n-1):
    u,v = map(int,input().split())
    G[u-1].append(v-1)
    G[v-1].append(u-1)

from bisect import bisect
ansl = [0 for i in range(n)]
dp = [float("inf") for _ in range(n+1)]
dp[0] = -1
used = [0 for i in range(n)]
used[0] = 1


stack = []
def dfs(pos):
    idx = bisect(dp, al[pos] - 1)
    stack.append((idx, dp[idx]))
    dp[idx] = min(al[pos], dp[idx])
    ansl[pos] = bisect(dp, 10**18) - 1
    for v in G[pos]:
        if used[v] == 0:
            used[v] = 1
            dfs(v)
            idx, k = stack.pop()
            dp[idx] = k


dfs(0)
flag = False
for i in range(n):
    print(ansl[i])
### BUGGY CODE ###

#ABC154C

n, k = list(map(int,input().split()))
p = list(((int(x)+1)/2) for x in input().split())

ave = 0
j = 0

for i in range(n-k+1):
    temp = p[i:i+k]
    _ave = sum(temp)
    if _ave>=ave:
        ave = _ave
print(ave)

### FIXED CODE ###

#ABC154C

n, k = list(map(int,input().split()))
p = [((int(x)+1)/2) for x in input().split()]

ave = sum(p[0:k])
max = ave
for i in range(n-k):
    ave = ave-p[i]+p[k+i]
    if ave > max:
        max = ave
print(max)
### BUGGY CODE ###

N = int(input())
count = 0
flag = False
for i in range(1, N + 1):
    
    for j in range(1, N // 3):
        for l in range(1, N // 3):
            for r in range(1, N // 3):
                if j ** 2 + l ** 2 + r ** 2 + j * l + j * r + l * r == i:
                    if j == l == r:
                        flag = True
                        count = 1
                        break
                    else:
                        flag = True
                        count = 3
                        break
            if flag:
                break
        if flag:
            break            
    print(count)
    count = 0
    flag = False

### FIXED CODE ###

# # import math
N = int(input())
# # count = 0
# # flag = False
# # # n = int(math.sqrt(N))
n = 105

# # for i in range(1, N + 1):
    
# #     for j in range(1, n):
# #         for l in range(1, n):
# #             for r in range(1, n):
# #                 if j + l + r > N // 2:
# #                     continue
# #                 if j ** 2 + l ** 2 + r ** 2 + j * l + j * r + l * r == i:
# #                     if j == l == r:
# #                         flag = True
# #                         count = 1
# #                         break
# #                     else:
# #                         flag = True
# #                         count = 3
# #                         break
# #             if flag:
# #                 break
# #         if flag:
# #             break            
# #     print(count)
# #     count = 0
# #     flag = False
ans = [0] * 10050
for j in range(1, n):
    for l in range(1, n):
        for r in range(1, n):
            value = j * j  + l * l + r * r + j * l + j * r + l * r
            if value < 10050:
                ans[value] += 1

for i in range(N):
    print(ans[i + 1])
# n = int(input())
# ans = [0 for _ in range(10050)]
# for i in range(1,105):
#     for j in range(1,105):
#         for k in range(1,105):
#             v = i*i+j*j+k*k+i*j+j*k+k*i;
#             if v<10050:
#                 ans[v]+=1   
# for i in range(n):
#     print(ans[i+1])
### BUGGY CODE ###

import collections

n=int(input())
aa=[input() for aa in range(n)]

myset=list(set(aa))
#print(myset)

mycount=0
for bb in myset:
    tmp=aa.count(bb)
    if tmp%2==1:
        mycount+=1

print(mycount)


### FIXED CODE ###

from collections import Counter

n=int(input())

mylist=[input() for aa in range(n)]
#print(aa)

data=Counter(mylist)
val=list(data.values())
val=[1 for aa in val if aa%2==1]
print(sum(val))
### BUGGY CODE ###

n,m=map(int, input().split())
a = []
for i in range(m):
    a.append(int(input()))

dp = [0] * (n+1)
dp[0] = 1
if (1 in a):
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if (i in a):
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2])%(10**9+7)

print(dp[n])

### FIXED CODE ###

N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])