Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math


def main():
    H, W = [int(a) for a in input().split()]
    A = [[int(a) for a in input().split()] for _ in range(H)]

    od = None
    res = []
    for i in range(H):
        if i % 2 == 0:
            r = range(W)
        else:
            r = reversed(range(W))
        for j in r:
            cell = A[i][j]
            if od is None:
                if cell % 2 != 0:
                    od = i, j
            else:
                res.append((*od, i, j))
                if cell % 2 == 0:
                    od = i, j
                else:
                    od = None

    print(len(res))
    for a, b, c, d in res:
        print(a+1, b+1, c+1, d+1)


if __name__ == '__main__':
    main()


Fixed submission:
import math


def main():
    H, W = [int(a) for a in input().split()]
    A = [[int(a) for a in input().split()] for _ in range(H)]

    od = None
    res = []
    for i in range(H):
        if i % 2 == 0:
            r = range(W)
        else:
            r = reversed(range(W))
        for j in r:
            cell = A[i][j]
            if od is None:
                if cell % 2 != 0:
                    od = i, j
            else:
                res.append((od[0],od[1], i, j))
                if cell % 2 == 0:
                    od = i, j
                else:
                    od = None

    print(len(res))
    for a, b, c, d in res:
        print(a + 1, b + 1, c + 1, d + 1)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python

import sys
from typing import List


def main(arg: List[str]):
    s = input()
    i = "AC" in s
    if i:
        print("Yes")
    else:
        print("No")
    # print(123)
    # b = [int(a) for a in input().split(" ")]
    # print(b)
    # [input() for a in range(3)]


if __name__ == "__main__":
    main(sys.argv)


Fixed submission:

def main():
    s = input()
    i = "AC" in s
    if i:
        print("Yes")
    else:
        print("No")
    # print(123)
    # b = [int(a) for a in input().split(" ")]
    # print(b)
    # [input() for a in range(3)]


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import functools

def check(s):
    if len(s)==0 or len(s)==1:
        return 0
    head = s[0]
    tail = s[-1]
    if head ==tail:
        return check(s[1:-1])
    if head =="x":
        return 1+check(s[1:])
    if tail =="x":
        return 1+check(s[:-1])
    return -1

def main():
    n = check(input())
    print(n)

    # total = functools.reduce(lambda a, b: a * (2 if b % 2 == 1 else 1),A)
    # print(pow(3 ,len(A)-1)*total)
    # # print(123)
    # b = [int(a) for a in input().split(" ")]
    # print(b)
    # [input() for a in range(3)]


if __name__ == "__main__":
    main()


Fixed submission:
import functools


def check(s):
    result = 0
    sss = s

    while True:
        if len(sss) <= 1:
            break
        head = sss[0]
        tail = sss[-1]
        if head == tail:
            sss = sss[1:-1]
            continue
        if head == "x":
            result += 1
            sss = sss[1:]
            continue
        if tail == "x":
            result += 1
            sss = sss[:-1]
            continue
        return -1
    return result

def main():
    n = check(input())
    print(n)

    # total = functools.reduce(lambda a, b: a * (2 if b % 2 == 1 else 1),A)
    # print(pow(3 ,len(A)-1)*total)
    # # print(123)
    # b = [int(a) for a in input().split(" ")]
    # print(b)
    # [input() for a in range(3)]


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict, deque, Counter
import sys
from scipy.special import comb
import heapq
import math

input = sys.stdin.readline

sys.setrecursionlimit(10000000)

MIN = -10 ** 9
MOD = 10 ** 9 + 7


def main():
    N, A, B = [int(a) for a in input().split()]
    V = sorted([int(a) for a in input().split()], reverse=True)

    s = sum(V[:A]) / A
    target = V[A - 1]
    if target == V[0]:
        co = V.count(target)
        t = sum(
            comb(co, c, exact=True)
            for c in range(A, min(B, co) + 1)
        )
        print(s)
        print(t)
        return

    c1 = V[:A].count(target)
    c2 = V.count(target)
    t = comb(c2, c1, exact=True)
    print(s)
    print(t)


if __name__ == '__main__':
    main()


Fixed submission:
from scipy.misc import comb 
from collections import defaultdict, deque, Counter
import sys
#from scipy.special import comb
import heapq
import math

input = sys.stdin.readline

sys.setrecursionlimit(10000000)

MIN = -10 ** 9
MOD = 10 ** 9 + 7


def main():
    N, A, B = [int(a) for a in input().split()]
    V = sorted([int(a) for a in input().split()], reverse=True)

    s = sum(V[:A]) / A
    target = V[A - 1]
    if target == V[0]:
        co = V.count(target)
        t = sum(
            comb(co, c, exact=True)
            for c in range(A, min(B, co) + 1)
        )
        print(s)
        print(t)
        return

    c1 = V[:A].count(target)
    c2 = V.count(target)
    t = comb(c2, c1, exact=True)
    print(s)
    print(t)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict

MAX = 40001


def main():
    N, Ma, Mb = [int(a) for a in input().split()]

    abc = [
        [int(a) for a in input().split()]
        for _ in range(N)
    ]

    dp = [
        [
            [MAX for b in range(10 * N + 1)]
            for a in range(10 * N + 1)
        ]
        for i in range(N)
    ]  # dp[i][a][b] = i番目までを使ってaグラムbグラムを作る最小コスト

    a, b, c = abc[0]
    dp[0][a][b] = c
    dp[0][0][0] = 0

    for i in range(1, N):
        a, b, c = abc[i]
        for j in range(10 * N):
            for k in range(10 * N):
                tukawanai = dp[i - 1][j][k]
                if j - a >= 0 and k - b >= 0 and dp[i - 1][j - a][k - b] != MAX:
                    tukau = dp[i - 1][j - a][k - b] + c
                    dp[i][j][k] = min(tukawanai, tukau)
                else:
                    dp[i][j][k] = tukawanai

    res = MAX
    l = dp[-1]
    for a in range(1,10 * N+1):
        aa = a * Mb
        if aa % Ma != 0:
            continue
        b = aa // Ma
        if b >= len(l[a]):
            continue
        c = l[a][b]
        res = min(res, c)

    if res == MAX:
        res = -1
    print(res)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict

MAX = 40001


def main():
    N, Ma, Mb = [int(a) for a in input().split()]

    abc = [
        [int(a) for a in input().split()]
        for _ in range(N)
    ]

    dp = [
        [
            [MAX for b in range(10 * N + 1)]
            for a in range(10 * N + 1)
        ]
        for i in range(N)
    ]  # dp[i][a][b] = i番目までを使ってaグラムbグラムを作る最小コスト

    A, B, C = abc[0]
    # dp[0][a][b] = c
    # dp[0][0][0] = 0

    mem = {(0, A, B): C, (0, 0, 0): 0}

    def solve(i, a, b):
        if (i, a, b) in mem:
            return mem[(i, a, b)]
        if i == 0:
            return MAX
        ai, bi, ci = abc[i]
        tukawanai = solve(i - 1, a, b)
        if a - ai >= 0 and b - bi >= 0:
            pre = solve(i - 1, a - ai, b - bi)
            if pre != MAX:
                mem[(i, a, b)] = min(tukawanai, pre + ci)
                return mem[(i, a, b)]
        mem[(i, a, b)] = tukawanai
        return mem[(i, a, b)]

    res = MAX
    for a in range(1, 10 * N + 1):
        aa = a * Mb
        if aa % Ma != 0:
            continue
        b = aa // Ma
        if b >= 10 * N + 1:
            continue
        c = solve(N - 1, a, b)
        res = min(res, c)

    if res == MAX:
        res = -1
    print(res)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, m = MI()
    G = [set() for _ in range(n+1)]
    for _ in range(m):
        a, b =MI()
        G[a].add(b)
        G[b].add(a)
    for i in range(n+1):
        G[i] = list(G[i])
    num = [-1]*(n+1)
    seen = [False]*(n+1)
    stack = []
    for i in range(1, n+1):
        if not seen[i]:
            stack.append(i)
            while stack:
                vertex = stack.pop(-1)
                seen[vertex] = True
                num[vertex] = i
            
                for j in range(len(G[vertex])):
                    neighbor = G[vertex][j]
                    if not seen[neighbor]:
                        stack.append(neighbor)
    c = collections.Counter(num)
    print(c.most_common()[0][1])

if __name__ == '__main__':
    main()

Fixed submission:
import sys
import collections

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, m = MI()
    G = [set() for _ in range(n+1)]
    for _ in range(m):
        a, b =MI()
        G[a].add(b)
        G[b].add(a)
    for i in range(n+1):
        G[i] = list(G[i])
    num = [-1]*(n+1)
    seen = [False]*(n+1)
    stack = []
    for i in range(1, n+1):
        if not seen[i]:
            stack.append(i)
            while stack:
                vertex = stack.pop(-1)
                seen[vertex] = True
                num[vertex] = i
            
                for j in range(len(G[vertex])):
                    neighbor = G[vertex][j]
                    if not seen[neighbor]:
                        stack.append(neighbor)
    c = collections.Counter(num)
    print(c.most_common()[0][1])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, k = MI()
    A = LI()
    score = [1]*n
    for i in range(0, k):
        score[k-1] *= A[i]
    for i in range(k, n):
        score[i] = (score[i-1]//A[i-k])*A[i]
        if score[i-1] < score[i]:
            print('Yes')
        else:
            print('No')



if __name__ == '__main__':
    main()

Fixed submission:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, k = MI()
    A = LI()
    for i in range(k, n):
        if A[i-k] < A[i]:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, k = MI()
    A = LI()
    score = [1]*n
    for i in range(0, k):
        score[k-1] *= A[i]
    for i in range(k, n):
        score[i] = (score[i-1]//A[i-k])*A[i]
        if score[i-1] < score[i]:
            print('Yes')
        else:
            print('No')



if __name__ == '__main__':
    main()

Fixed submission:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, k = MI()
    A = LI()
    for i in range(k, n):
        if A[i-k] < A[i]:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    f = [1]*(n+1)
    for i in range(2, n+1):
        for j in range(i, n+1, i):
            f[j] += 1
    ans = 0
    for k in range(1, n+1):
        ans += k*f[k]
    print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    f = [1]*(n+1)
    ans = 1
    for i in range(2, n+1):
        for j in range(i, n+1, i):
            f[j] += 1
        ans += i*f[i]
    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    a = LI()
    q = I()
    b = [0]*q
    c = [0]*q
    for i in range(q):
        b[i], c[i] = MI()
    a_sum = sum(a)
    a_dict = dict()
    for ai in a:
        a_dict[str(ai)] = a.count(ai)
    for i in range(q):
        temp1 = 0
        if str(b[i]) in a_dict:
            temp1 = a_dict[str(b[i])]
        temp2 = 0
        if str(c[i]) in a_dict:
            temp2 = a_dict[str(c[i])]
        a_dict[str(c[i])] = temp1+temp2
        a_sum += (c[i]-b[i])*temp1
        print(a_sum)

if __name__ == '__main__':
    main()

Fixed submission:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    a = LI()
    q = I()
    b = [0]*q
    c = [0]*q
    for i in range(q):
        b[i], c[i] = MI()
    a_num = [0]*100001
    for ai in a:
        a_num[ai] += 1
    a_sum = sum(a)
    for i in range(q):
        a_sum += (c[i]-b[i])*a_num[b[i]]
        a_num[c[i]] += a_num[b[i]]
        a_num[b[i]] = 0
        print(a_sum)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

x, n = map(int, input().split())
p = list(map(int, input().split()))
flag = [False]*100
for i in p:
    flag[i-1] = True
for j in range(0, n+1):
    l = max(0, x-1-j)
    r = min(100, x-1+j)
    if not flag[l]:
        print(l+1)
        sys.exit()
    if not flag[r]:
        print(r+1)
        sys.exit()

Fixed submission:
import sys

x, n = map(int, input().split())
p = list(map(int, input().split()))
flag = [False]*102
for i in p:
    flag[i] = True
for j in range(0, 102):
    l = max(0, x-j)
    r = min(101, x+j)
    if not flag[l]:
        print(l)
        sys.exit()
    if not flag[r]:
        print(r)
        sys.exit()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

INF = 10e17
N = int(input())
A = list(map(int, sys.stdin.readline().rstrip().split()))
ans = 1
for i in range(N//2):
    ans = ans*A[i]*A[N-1-i]
    if ans == 0:
        print(0)
        sys.exit()
if N%2:
    ans = ans*A[N//2]
if ans > INF:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys

INF = 10e17
N = int(input())
A = list(map(int, sys.stdin.readline().rstrip().split()))
ans = 1
for a in A:
    if a == 0:
        print(0)
        sys.exit()
for a in A:
    ans = ans*a
    if ans > INF:
        print(-1)
        sys.exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
INF = 10e17
N = int(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
    ans = ans*a
if ans > INF:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys

INF = 10e17
N = int(input())
A = list(map(int, sys.stdin.readline().rstrip().split()))
ans = 1
for a in A:
    if a == 0:
        print(0)
        sys.exit()
for a in A:
    ans = ans*a
    if ans > INF:
        print(-1)
        sys.exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
hoge = list(input().split())
A = int(hoge[0])
B1 = int(hoge[1])
B2 = (float(hoge[1])-B1)*100
ans = A*B1 + A*B2//100
print(ans)

Fixed submission:
A, B = input().split()
A = int(A)
B1, B2 = map(int, B.split('.'))
ans = A*B1 + A*B2//100
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    s =input()
    cnt = 0
    for i in range(n):
        for j in range(i+1, n):
            if s[i] == s[j]:
                continue
            for k in range(j+1, n):
                if s[i] == s[k] or s[j] == s[k]:
                    continue
                if j-i != k-j:
                    cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Fixed submission:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    s = list(input())
    r = s.count('R')
    g = s.count('G')
    b = s.count('B')
    cnt = r*g*b
    for i in range(n):
        for j in range(i+1, n):
            k = 2*j - i
            if k >= n:
                break
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                cnt -= 1
    print(cnt)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    s =input()
    cnt = 0
    for i in range(n):
        for j in range(i+1, n):
            if s[i] == s[j]:
                continue
            for k in range(j+1, n):
                if s[i] == s[k] or s[j] == s[k]:
                    continue
                if j-i != k-j:
                    cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Fixed submission:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    s = list(input())
    r = s.count('R')
    g = s.count('G')
    b = s.count('B')
    cnt = r*g*b
    for i in range(n):
        for j in range(i+1, n):
            k = 2*j - i
            if k >= n:
                break
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                cnt -= 1
    print(cnt)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int, input().split()))
xmin = min(x)
xmax = max(x)
hp = 10e10
for p in range(xmin, xmax+1):
    temp = 0
    for xi in x:
        temp += (xi-p)*(xi-p)
    hp = min(temp,)
print(hp)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
xmin = min(x)
xmax = max(x)
hp = 10e10
for p in range(xmin, xmax+1):
    temp = 0
    for xi in x:
        temp += (xi-p)*(xi-p)
    hp = min(temp, hp)
print(hp)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    S = [input() for _ in range(n)]
    word = sorted(list(set(S)))
    word_cnt = [0]*len(word)
    maxi = 0
    for i, w in enumerate(word):
        word_cnt[i] = S.count(w)
        maxi = max(maxi, word_cnt[i])
    for i, w in enumerate(word):
        if word_cnt[i] == maxi:
            print(w)


if __name__ == '__main__':
    main()

Fixed submission:
import collections
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    S = [input() for _ in range(n)]
    word = collections.Counter(S).most_common()
    maxi = word[0][1]
    ans = []
    for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
    ans.sort()
    a = "\n".join(ans)
    print(a)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    S = [input() for _ in range(n)]
    word = sorted(list(set(S)))
    word_cnt = [0]*len(word)
    maxi = 0
    for i, w in enumerate(word):
        word_cnt[i] = S.count(w)
        maxi = max(maxi, word_cnt[i])
    for i, w in enumerate(word):
        if word_cnt[i] == maxi:
            print(w)


if __name__ == '__main__':
    main()

Fixed submission:
import collections
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    S = [input() for _ in range(n)]
    word = collections.Counter(S).most_common()
    maxi = word[0][1]
    ans = []
    for w in word:
        if w[1] == maxi:
            ans.append(w[0])
        else:
            break
    ans.sort()
    a = "\n".join(ans)
    print(a)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
n = len(s) + 1
a = [0]*n
for i in range(n):
    right = 0
    left = 0
    if i != n-1:
        j = i
        while True:
            if j == n-1 or s[j] != '>':
                break
            right += 1
            j += 1
    if i != 0:
        j = i-1
        while True:
            if j == -1 or s[j] != '<':
                break
            left += 1
            j -= 1
    a[i] = max(right, left)
print(sum(a))

Fixed submission:
s = list(input())
n = len(s) + 1
left = [0]*n
right = [0]*n
for i in range(n-1):
    if s[i] == '<':
        left[i+1] = left[i] + 1
for i in range(n-2, -1, -1):
    if s[i] == '>':
        right[i] = right[i+1] + 1
a = [0]*n
for i in range(n):
    a[i] = max(left[i], right[i])
ans = sum(a)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
n = len(S)
flag = True
cnt = 0
while flag:
    flag = False
    for i in range(n-1):
        if S[i] == 'B' and S[i+1] == 'W':
            S[i] = 'W'
            S[i+1] = 'B'
            flag = True
            cnt += 1
            break
print(cnt)

Fixed submission:
S = list(input())
n = len(S)
cnt_b = 0
cnt = 0
for i in range(n):
    if S[i] == 'B':
        cnt_b += 1
        cnt += i
ans = int((2*n - cnt_b -1)*cnt_b*0.5 - cnt)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

n, k = map(int, input().split())
A = list(map(int, input().split()))
A_set = set(A)
if len(A_set) <= k:
    print(0)
    sys.exit()
A_count = [0]*len(A_set)
for i, a in enumerate(A_set):
    A_count[i] = A.count(a)
A_count.sort()

num = len(A_set) - k
s = 0
for i in range(num):
    s += A_count[i]
print(s)

Fixed submission:
n, k = map(int, input().split())
A = list(map(int, input().split()))
num = [0]*n
for a in A:
    num[a-1] += 1
num.sort(reverse=True)
cnt = 0
for i in range(k):
    cnt += num[i]
ans = n - cnt
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [0]*n
for i in range(n):
    A[i] = int(input())
paper = []
for a in A:
    if a in paper:
        paper.remove(a)
    else:
        paper.append(a)
print(len(paper))

Fixed submission:
n = int(input())
A = [0]*n
for i in range(n):
    A[i] = int(input())
paper = set()
for a in A:
    if a in paper:
        paper.remove(a)
    else:
        paper.add(a)
print(len(paper))