Problem:


Score : 300 points

Problem Statement

You are playing the following game with Joisino.

Initially, you have a blank sheet of paper.

Joisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.

Then, you are asked a question: How many numbers are written on the sheet now?

The numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?

Constraints

1≤N≤100000

1≤A_i≤1000000000(=10^9)

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
A_1
:
A_N

Output

Print how many numbers will be written on the sheet at the end of the game.

Sample Input 1

3
6
2
6

Sample Output 1

1

The game proceeds as follows:

6 is not written on the sheet, so write 6.

2 is not written on the sheet, so write 2.

6 is written on the sheet, so erase 6.

Thus, the sheet contains only 2 in the end. The answer is 1.

Sample Input 2

4
2
5
5
2

Sample Output 2

0

It is possible that no number is written on the sheet in the end.

Sample Input 3

6
12
22
16
22
18
12

Sample Output 3

2



Sample input:
3
6
2
6


Sample output:
1

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

my_set = set()

for item in a:
    if item in my_set:
        my_set.remove(item)
    else:
        my_set.add(item)

print(len(my_set))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [int(input()) for _ in range(n)]
a_count = Counter(a)
cnt = 0
for key,value in a_count.items():
    if value % 2 == 1:
        cnt += 1
    else:
        pass
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
dic_a = {}
for i in range(N):
    a= int(input())
    if a in dic_a:
        dic_a[a] +=1
        dic_a[a] = dic_a[a]%2
    else:
        dic_a[a] = 1
print(sum(list(dic_a.values())))

Submission status: Accepted

Solution code:
N = int(input())
ans = set()

for _ in range(N):
    a = int(input())
    if not a in ans:
        ans.add(a)
    else:
        ans.remove(a)
print(len(ans))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

N = int(input())
A = [int(input()) for _ in range(N)]
C = collections.Counter(A)
data = list(C.values())

ans = 0

for i in range(len(data)):
    if data[i] % 2 == 1:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
arr=[0]*n
for i in range(n):
    arr[i]=int(input())

arr=sorted(arr)
num=arr[0]
tmp=1
ans=0
for i in range(1,n):
    if arr[i]==num:
        tmp+=1
    else:
        if tmp%2==1:
            ans+=1
        num=arr[i]
        tmp=1
if tmp%2==1:
    ans+=1    
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
c=Counter([int(input())for i in range(n)])
a=0
for i in c.values():a+=1if i%2else 0
print(a)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [int(input()) for i in range(n)]
p = Counter(a)
ans = 0
for i in p:
    if p[i] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d = dict()
for _ in range(n):
    a = int(input())
    d.setdefault(a, -1)
    d[a] *= -1

ans = 0    
for k, v in d.items():
    if v == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
N,*A = map(int,open(0).read().split())
d = defaultdict(int) #初期値１
for a in A:
    d[a] ^= 1 #0と1を反転
print(sum(d.values()))

Submission status: Accepted

Solution code:
N = int(input())

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

st = 0
ans = 0
a.sort()
for i in range(N):
    if a[i] == st:
        ans -= 1
        st = 0
    else:
        ans += 1
        st = a[i]
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[int(input()) for _ in range(n)]
c=Counter(a)
ret=0
for list in c.items():
    if list[1]%2==1:
        ret+=1
print(ret)

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i in range(n):
    a = int(input())
    if a in d:
        d[a] += 1
    else:
        d[a] = 1
c = 0
for i in d:
    if d[i] % 2 == 1:
        c += 1
print(c)

Submission status: Accepted

Solution code:
import collections as cl
N = int(input())
x = []
count = 0

for i in range(N):
    a = int(input())
    x.append(a)

d = cl.Counter(x)

for i in d.values():
    if i % 2 == 1:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import collections
n = int(input())
l = []
for i in range(n):
  l.append(int(input()))
d = collections.Counter(l)
ans = 0
for v in d.values():
  if v % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
N,*A = map(int,open(0).read().split())
d = defaultdict(int) #初期値１
for a in A:
    d[a] ^= 1 #0と1を反転
print(sum(d.values()))

Submission status: Accepted

Solution code:
from collections import Counter
N,*A = map(int,open(0).read().split())
ca = Counter(A)
copy_ca = ca.copy()
for i in ca.items():
    if i[1] % 2 == 0:
        del copy_ca[i[0]]
print(len(copy_ca))

Submission status: Accepted

Solution code:
n = int(input())
d = dict()
for _ in range(n):
    a = int(input())
    d.setdefault(a, -1)
    d[a] *= -1

ans = 0    
for k, v in d.items():
    if v == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
d=dict()
for i in range(n):
    a=input()
    if a in d:
        d[a]=(d[a]+1)%2
    else:
        d[a]=1
print(len([i for i,j in d.items() if j==1]))
#print(d.items())

Submission status: Accepted

Solution code:
_, *a = map(int, open(0))
from collections import*
print(sum(map(lambda k:k%2, Counter(a).values())))

Submission status: Accepted

Solution code:
from collections import defaultdict
p = defaultdict(int)
for q in range(int(input())):
    a = int(input())
    p[a] += 1
ans = 0
for q in p.values():
    ans += 1 if q % 2 else 0
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
from collections import Counter
c=Counter()
for i in range(n):
  aa=int(input())
  if c[aa]>0:
    c[aa]-=1
    continue
  else:
    c[aa]+=1
ans=0
for k,v in c.items():
  if v>0:ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = [int(input()) for _ in range(N)]
from collections import Counter

c = Counter(As)
ans = 0
for i, cnt in c.most_common():
    if cnt%2==0:
        continue
    else:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for _ in range(n)]

p = {}
for a in A:
    if a in p:
        if p[a] == 1:
            p[a] = 0
            continue
    p[a] = 1
ans = 0
for i in p.values():ans += i
print(ans)

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = [I() for _ in range(n)]
dic = Counter(A)
cnt = 0
for k,v in dic.items():
    if v%2:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
s = set()
for _ in range(n):
	a = int(input())
	if a in s:
		s.discard(a)
	else:
		s.add(a)
print(len(s))

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

from collections import Counter

def main():
    n = int(input())
    numbers=[]
    answers=[]
    number=0
    numbers=[int(input()) for _ in range(n)]
    Numbers_col = Counter(numbers)

    for number in Numbers_col.values():
        if number%2!=0:
            answers.append(number)
    print(len(answers))

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import collections

N=int(input())
check1=list()
for i in range(N):
  check1.append(int(input()))
c=collections.Counter(check1)
check2=set(check1)
ans=0
for i in check2:
  if c[i]%2!=0:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = [int(input()) for _ in range(n)]
result = 0
cnt = collections.Counter(a)
for i in cnt.values():
    if i % 2 == 1:
        result += 1

print(result)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]
import collections
c = collections.Counter(A)
#print(c)
ans = 0
for i in c:
  if c[i] % 2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N,*A = open(0)
S = set()

for a in A:
  S^={int(a)}

print(len(S))

Submission status: Accepted

Solution code:
from collections import *
N = int(input())
C = Counter([int(input()) for n in range(N)]) 
A = [1 for v in C.values() if v%2==1]
print(sum(A))

Submission status: Accepted

Solution code:
n = int(input())

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

import collections
c = collections.Counter(a)

res = 0
for i in c:
  if c[i] % 2 != 0:
    res += 1
print(res)

Submission status: Accepted

Solution code:
import collections


n = int(input())
keep = []
ans = 0
for i in range(n):
    j = int(input())
    keep.append(j)

c = collections.Counter(keep)
print(len([i[0] for i in c.items() if i[1] % 2 != 0]))

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
A = defaultdict(int)
for i in range(n):
    a = int(input())
    if A[a] == 1:
        A[a] = 0
    else:
        A[a] = 1
print(sum(A.values()))

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
c = 1
ans = 0
for i in range(1, n):
  if l[i-1] == l[i]:
    c += 1
  else:
    ans += c%2
    c = 1
if c != 1:
  ans += c%2
else:
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = set()
for i in sys.stdin:
    A ^= {i}
print(len(A))

Submission status: Accepted

Solution code:
N = int(input())
A = set()
for i in range(N):
    A ^= {input()}
print(len(A))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    ans = set()
    for _ in range(N):
        A = int(input().strip())
        if A in ans:
            ans.remove(A)
        else:
            ans.add(A)

    return len(ans)


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
A = Counter(list(int(input()) for _ in range(n)))
ans = 0
for a in A.values():
  if a%2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
A = Counter([int(input()) for _ in range(n)])
cnt = 0
for k in A.values():
    if k%2 != 0:
        cnt +=1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
a = [int(input()) for _ in range(n)]
cnt = Counter(a)
ans=0
for val in set(a):
    if cnt[val]%2!=0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
apple = []
for _ in range(n):
    apple.append(int(input()))
apple = sorted(apple)
apple.append(0)
count = 0
ans = 1
for i in range(n):
    if apple[i] == apple[i + 1]:
        ans += 1
    else:
        if ans%2 == 0:
            ans = 1
        else:
            count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

from collections import Counter

c = Counter(a)
print(sum([1 for num,cnt in c.items() if cnt%2==1]))

Submission status: Accepted

Solution code:
n = int(input())
d = {}

for i in range(n):
    a = int(input())
    if a in d:
        del d[a]
    else:
        d[a] = 1

print(len(d))

Submission status: Accepted

Solution code:
def resolve():
    from collections import defaultdict
    N = int(input())
    A = [int(input()) for _ in range(N)]
    c = defaultdict(int)
    for a in A:
        c[a] += 1
    ans = 0
    for v in c.values():
        if v % 2 == 1:
            ans += 1
    print(ans)


resolve()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

ans = set()
for each in a:
  if each in ans:
    ans.remove(each)
  else:
    ans.add(each)
    
print(len(ans))

Submission status: Accepted

Solution code:
n = int(input())
dic = {}
ans = 0
for i in range(n):
  temp = input()
  if not temp in dic:
    dic[temp]=1
    ans += 1
  elif dic[temp]==0:
    dic[temp]=1
    ans+=1
  elif dic[temp]==1:
    dic[temp]=0
    ans-=1
print(ans)

Submission status: Accepted

Solution code:
import re

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

for i in range(n):
    a = input()
    if a in s:
        s[a] = not s[a]
    else:
        s[a] = True

print(list(s.values()).count(True))

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
A=Counter([int(input()) for i in range(N)])
print(sum(1 if count%2 else 0 for count in A.values()))

Submission status: Accepted

Solution code:
import collections;print(len([1 for i in collections.Counter([int(input()) for i in range(int(input()))]).values() if i%2!=0]))

Submission status: Accepted

Solution code:
from collections import Counter
print(len([1 for i in Counter([int(input()) for i in range(int(input()))]).values() if i%2!=0]))

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
print(len([1 for i in Counter([int(input()) for i in range(N)]).values() if i%2!=0]))

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for i in range(N)]
dict = {}
for i in A:
  if i not in dict:
    dict[i] = 1
  else:
    dict[i] += 1
print(len([1 for i in dict.values() if i%2!=0]))

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = []
for i in range(N): A.append(int(input()))
count = Counter(A).values()
ans = 0
for i in count :ans += i % 2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

rlt = 0
dic = {}

for _ in range(N):
  a = input()
  if a not in dic:
    dic[a] = 1
  else:
    dic[a] += 1
    
for k in dic:
  if dic[k] % 2 == 1:
    rlt += 1
    
print(rlt)

Submission status: Accepted

Solution code:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]
if cnt%2 != 0:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = []
cnt = 0
for i in range(n):
    x = int(input())
    l.append(x)


x = sorted(l)
i=1
same=1
while i<n:
    if x[i]==x[i-1]:
        same += 1
    else:
        if same%2 == 1:
            cnt += 1
        same = 1
    i += 1

cnt += same%2
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = [int(input()) for _ in range(N)]
c = Counter(A)
ans = 0
for value in c.values():
    if value % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

s = set()
for i in range(N):
    A = int(input())
    if A in s:
        s.remove(A)
    else:
        s.add(A)

print(len(s))

Submission status: Accepted

Solution code:
n = int(input())
a=[]
for x in range(n):
    a.append(int(input()))
numlist = sorted(a)
t = a[0]
m = [0]
p = 0
for x in numlist:
    if t == x:
        m[-1] += 1
    else:
        m.append(1)
        t=x
for x in m:
    if x % 2 == 1:
        p += 1
print(p)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

N = int(input())
d = {}
for i in range(N):
    a = int(input())
    if a in d and d[a]:
        d[a] = 0
    else:
        d[a] = 1
cnt = 0
for a in d:
    if d[a]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
count = [0]*n
ans = set([])
for i in range(n):
    if a[i] in ans:
        ans.remove(a[i])
    else:
        ans.add(a[i])
print(len(ans))

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for _ in range(n)]
from collections import defaultdict
ans=0
d=defaultdict(int)
for ai in a:
  d[ai]+=1
  ans+=1 if d[ai]%2==1 else -1
print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = []
for _ in range(N):
    A.append(int(input())) 

# 0の時と、全部が同じ数の時の場合分け。

if N == 1:
    print(1)
    sys.exit()

if set(A) == 1:
    print(0)
    sys.exit()

A = sorted(A)


count = 1
ans = 0
firstnum = A[0] 
for i in range(1,N):
    if firstnum == A[i]:
        count = count + 1
    else:
        if count % 2 == 0:
            count = 1
        else:
            ans = ans + 1
            count = 1

    firstnum = A[i]  

if count%2 == 0:
  ans = ans +0
else:
  ans = ans + 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=set()
for i in range(n):
    s^={input()}
print(len(s))

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
a = [int(input()) for _ in range(n)]
cnt = 0

for i, n in Counter(a).items():
    if n % 2 == 1:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
# abc073_c.py
N = int(input())
A = [int(input()) for i in range(N)]
ans = set()
for i in A:
    if i in ans:
        ans.discard(i)
    else:
        ans.add(i)
print(len(ans))

Submission status: Accepted

Solution code:
from collections import defaultdict
dic = defaultdict(int)

N = int(input())
for _ in range(N):
    v = int(input())
    dic[v] += 1

count = 0
for k, v in dic.items():
    if v%2:
        # push
        count += 1
    else:
        # push & pop
        pass
print(count)

Submission status: Accepted

Solution code:
from collections import defaultdict

d = defaultdict(int)
n = int(input())
for i in range(n):
    x = int(input())
    d[x] += 1
ans = 0
for key, value in d.items():
    if value % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
ans = 0
a = A[0]
n = 0
if N == 1:
    print(1)
    sys.exit()
for i in range(N):
    if a == A[i]:
        n += 1
    else:
        if n % 2 == 1:
            ans += 1
        n = 1
        a = A[i]
    #print(A[i],"1",n,n%2,ans)
if A[-1] == A[-2] and n % 2 == 1:
    ans += 1
elif A[-1] != A[-2] and n % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections
n = int(input())
ls = [int(input()) for i in range(n)]
ls.sort()
c = collections.Counter(ls)
d = list(c)
p = 0
for j in range(len(c)):
    if c[d[j]] % 2 ==0:
        continue
    else:
        p += 1
print(p)

Submission status: Accepted

Solution code:
from collections import Counter

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

counter = Counter(a)
ans=0
for key in counter:
    if counter[key]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=set()
for i in range(N):
    a=int(input())
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Submission status: Accepted

Solution code:
def main():
  N = int(input())
  dic = {}
  for i in range(N):
    a = int(input())
    if dic.get(a):
      dic[a] += 1
    else:
      dic[a] = 1
  ans = 0
  for val in dic.values():
    if val % 2 == 1:
      ans += 1
  print(ans)

if  __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

ans = set()
for i in a:
    ans ^= {i}
print(len(ans))

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
input = sys.stdin.readline

 
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n = I()
d = defaultdict(int)
for i in range(n):
    temp = I()
    d[temp] += 1
ans = 0
for i in d.values():
    if i % 2 == 1:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
dictA = {}
for x in range(N):
    k = int(input())
    dictA.setdefault(k, 0)
    dictA[k] += 1
count = 0
for y in dictA.values():
    if y % 2 == 1:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    N = int(input())
    A = [0] * N
    for i in range(N):
        A[i] = int(input())

    c = Counter(A)
    ans = 0
    for v in c.values():
        if v % 2 == 1:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N,*A=map(int,open(0))
import collections
C=collections.Counter(A)
print(sum(v%2>0 for v in C.values()))

Submission status: Accepted

Solution code:
n = int(input())
d = {}

for i in range(n):
  temp = "key" + input()
  if temp in d:
    del d[temp]

  else:
    d[temp] = 1

ans = 0
for i in d:
  ans += d[i]
  
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
kami = set([])
for i in range(n):
	a = input()
	if a in kami:
		kami.remove(a)
	else:
		kami.add(a)
print(len(kami))

Submission status: Accepted

Solution code:
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from fractions import gcd
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (
    acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians,
    sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


count = dict()

n = inp()

for _ in range(n):
    a = inp()
    if a in count:
        count[a] += 1
    else:
        count[a] = 1

c = 0

for key in count:
    c += count[key] % 2
print(c)

Submission status: Accepted

Solution code:
N, *A = map(int, open(0).read().split())
d = dict()
for a in A:
    d[a] = d.get(a, 0) ^ 1
print(sum(d.values()))

Submission status: Accepted

Solution code:
N = int(input())
d = dict()
for _ in range(N):
    a = int(input())
    d[a] = d.get(a, 0) ^ 1
print(sum(d.values()))

Submission status: Accepted

Solution code:
import collections
n = int(input())

l = []
for i in range(n):
    l.append(int(input()))
    
a = collections.Counter(l)
cnt = 0
for k,v in a.items():
    if v%2 != 0:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

adict = {}

for i in range(N):
  A = int(input())
  if A not in adict:
    adict[A] = True
  else:
    adict[A] = not adict[A]
    
ans = 0
for key in adict:
  if adict[key]:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
#ABC073-C
from collections import Counter
n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
  
cnt = 0
c = Counter(a)
for i in c.values():
    if i % 2 == 0:
        continue
    else:
        cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
ans = set()
for _ in range(n):
    ans^={input()}
print(len(ans))

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[int(input()) for _ in range(n)]
ans=0
C=Counter(a)
#print(C)
for k,v in C.items():
    if v%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter


def main():
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))
    counter = Counter(a)
    ans = 0
    for key, value in counter.items():
        if value % 2 == 1:
            ans += 1
    print(ans)


main()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = []
ans = 0
for i in range(N):
    A.append(int(input()))

c = Counter(A)
v = list(c.values())
for i in v:
    if i % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import *
N=int(input())
A=[]
for i in range(0,N):
    A.append(int(input()))
M=Counter(A)
ans=0
for i in M:
    if(M[i]%2):
        ans+=1
print(str(ans))

Submission status: Accepted

Solution code:
import sys
import math

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N=int(input())
cnt=0
li=[]

for _ in range(N):
	li.append(int(input()))
	
so=sorted(li)
ct=1

for i in range(N-1):
	if so[i]==so[i+1]:
		ct+=1
	else:
		cnt+=ct%2
		ct=1
		
cnt+=ct%2



if N==1:
	print(1)
else:	
	print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
S=set()

for n in range(N):
    _=int(input())
    if _ in S:
        S.remove(_)
    else:
        S.add(_)

print(len(S))

Submission status: Accepted

Solution code:
N=int(input())
s=set([])
for i in range(N):
  t=input()
  if t not in s:
    s.add(t)
  else:
    s.remove(t)
print(len(s))

Submission status: Accepted

Solution code:
from collections import defaultdict


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    ans = defaultdict(int)
    for a in A:
        if a in ans:
            ans.pop(a)
        else:
            ans[a] += 1

    print(len(ans))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import Counter


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    count = Counter(A)
    ans = 0
    for v in count.values():
        if v % 2 == 1:
            ans += 1
    return ans


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for _ in range(n)]
from collections import Counter
c=Counter(a)
print(len(list(filter(lambda x: x%2==1, c.values()))))

Submission status: Accepted

Solution code:
N = int(input())
A = []
B = []
for i in range(N):
  A.append(int(input()))
  
A.sort()
B.append(1)

for i in range(1, N):
  if(A[i]!= A[i- 1]):
    B.append(1)
  else:
    B[-1]+= 1
  i+= 1
  
ans = list(filter(lambda x: x % 2 == 1, B))

print(len(ans))

Submission status: Accepted

Solution code:
from collections import defaultdict

d = defaultdict(int)
N =int(input())
for i in range(N):
  a = int(input())
  d[a] += 1

ans = 0
for a in d:
  ans += d[a] % 2

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
a_counter = Counter([int(input()) for _ in range(N)])

ans = 0
for num, cnt in a_counter.items():
  if cnt % 2 == 1:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict

d = defaultdict(int)

N = int(input())
for i in range(N):
    d[int(input())] += 1

ans = sum([1 for i in d.values() if i % 2 == 1])
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter


N, *A = map(int, open(0).read().split())
ans = 0
for v in Counter(A).values():
    if v % 2:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

d = {}
ans = 0

for _ in range(n):
    a = int(input())
    if a in d:
        d[a] += 1
    else:
        d[a] = 1

for k,v in d.items():
    if v % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
as_ = [int(input()) for _ in range(n)]

data = set()

for a in as_:
    if a not in data:
        data.add(a)
    else:
        data.remove(a)

print(len(data))

Submission status: Accepted

Solution code:
import collections
n=int(input())
a=[int(input()) for i in range(n)]
b=collections.Counter(a)
count=0
for k,v in b.items():
  if v%2!=0:
    count+=1
print(count)

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
#sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)
N=l()[0]
s=set()
for i in range(N):
    a=l()[0]
    if(a in s):
        s.discard(a)
    else:
        s.add(a)
print(len(s))

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for i in range(n)]
count = 0
from collections import Counter
C = Counter(A)
for v in C.values():
	if v % 2:
		count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for i in range(n)]
count = 0
from collections import Counter
C = Counter(A)
for k in C.keys():
	if C[k] % 2:
		count += 1
print(count)

Submission status: Accepted

Solution code:
from collections import defaultdict
note = defaultdict(int)
for _ in range(int(input())):
    note[input()] ^= 1
print(sum(note.values()))

Submission status: Accepted

Solution code:
N = int(input())
d={}
for _ in range(N):
    n = int(input())
    if not n in d:
        d[n] = 1
    d[n]*=-1
print(list(d.values()).count(-1))

Submission status: Accepted

Solution code:
n = int(input())
ab = [int(input()) for _ in range(n)] #数字1*複数列入力

sab = set(ab)

import collections
c = collections.Counter(ab)
res = 0
for i in sab:
    temp = c[i]%2
    res +=temp

print(res)