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:
from collections import defaultdict
n = int(input())
d = defaultdict(int)
for _ in range(n):
    a = int(input())
    d[a] += 1

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

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
l = [int(input()) for _ in range(n)]
a= Counter(l).values()
print(sum(1 for i in a if i%2))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N=int(input())

dic={}

for _ in range(N):
    A=input()
    if A in dic:
        dic[A]^=1
    else:
        dic[A]=1

ans=dic.values()
print(sum(ans))

Submission status: Accepted

Solution code:
from collections import defaultdict as dd
n=int(input())
d=dd(int)
for i in range(n):
    a=int(input())
    if d[a]==0:
        d[a]+=1
    elif d[a]==1:
        d[a]-=1

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

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 k, v in c.items():
    if v % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = dict()
    for _ in range(n):
        x = int(input())
        if x in a:
            a[x] +=1
        else:
            a[x] = 1
    ans = 0
    for v in a.values():
        if v % 2 == 1:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
li = [int(input()) for i in range(n)]
dic = {}
for i in li:
    if i in dic:
        dic.pop(i)
    else:
        dic[i] = 1
print(len(dic))

Submission status: Accepted

Solution code:
import sys
import collections
N = int(input())
input = sys.stdin.readline
d = collections.defaultdict(int)
for i in range(N):
    a = int(input())
    d[a] += 1
ans = 0
for x in d:
    if d[x] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
S = set()
N = int(input())
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:
from collections import*
N=int(input())
A=[int(input()) for _ in range(N)]
c=Counter(A).values()
ans=sum([i%2==1 for i in c])
print(ans)

Submission status: Accepted

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

import collections


a = collections.Counter(a)

a=list(a.most_common())
# [('a', 4), ('c', 2), ('b', 1)]
count=0
for i in range(len(a)):
    if a[i][1]%2==1:
        count+=1
print(count)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

dic1 = dict()

n = int(readline())
for i in range(n):
    a = int(readline())
    if a in dic1:
        dic1[a] += 1
    else:
        dic1[a] = 1

ans = 0
for i in dic1.values():
    if not even(i):
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
from itertools import permutations
import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): 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 SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n=II()
    s=set()
    for _ in range(n):
        a=II()
        if a in s:s.remove(a)
        else:s.add(a)
    print(len(s))

main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import collections
n = int(input())
a = [int(input()) for _ in range(n)]

ans = 0
c = collections.Counter(a)
tmp = list(set(a))
for i in tmp:
    if c[i] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#template
from collections import Counter
def inputlist(): return [int(k) for k in input().split()]
#template
N = int(input())
A = [0]*N
for i in range(N):
    A[i] = int(input())
c = Counter(A)
keys = c.keys()
ans = 0
for i in keys:
    if c[i] % 2 != 0:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    numbers = {}
    for _ in range(n):
        a = int(input())
        if a in numbers:
            numbers[a] += 1
        else:
            numbers[a] = 1
    answer = 0
    for c in numbers.values():
        if c % 2 == 1:
            answer += 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n = INT()
arr = []
for i in range(n):
    a = INT()
    arr.append(a)
b = Counter(arr)
c = set(arr)
ans = len(c)
for i in c:
    if b[i] % 2 == 0:
        ans -= 1
print(ans)

Submission status: Accepted

Solution code:
def r(a):
    ll,l=[],1
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            l+=1
        else:
            ll.append([l,a[i]])
            l=1
    ll.append([l,a[-1]])
    return ll
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
a.sort()
a=r(a)
b=0
for i in range(len(a)):
    if a[i][0]%2==1:
        b+=1
print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ARR = []

for i in range(N):
    ARR.append(int(input()))


dict = {}


for ar in ARR:
    if dict.get(ar) == None:
        dict.__setitem__(ar,True)
    else:
        dict.__setitem__(ar,not dict.get(ar))

print(sum(dict.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
li=set()

for i in range(n):
    a=int(input())
    if a in li:
        li.remove(a)
    else:
        li.add(a)
 
print(len(li))

Submission status: Accepted

Solution code:
from collections import defaultdict 
N = int(input())
d = defaultdict(int)
for i in range(N):
    a = int(input())
    if d[a] == 0:
        d[a] += 1
    else:
        d[a] -= 1
cnt = 0
for k in d.keys():
    if d[k] > 0:cnt+=1
    
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
li=[]
ans=0
fl=1

for i in range(n):
    li.append(int(input()))

li.sort()

for j in range(n-1):
    if li[j]!=li[j+1]:
        if fl%2==1:
            ans+=1
            fl=1
        else:
            fl=1
    else:
        fl+=1


if fl%2==1:
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

lst = {}
for i in range(n):
    a = int(input())
    if a in lst.keys():
        lst[a]+=1
    else:
        lst[a]=1

ans = 0
for i in lst.keys():
    if lst[i]%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
P=set()
N=int(input())
for s in sys.stdin.readlines():
    n = int(s)
    if n in P:
        P.remove(n)
    else:
        P.add(n)
print(len(P))

Submission status: Accepted

Solution code:
dicc=dict()

n=int(input())
for i in range(n):
    ai=input()
    if ai in dicc:
        dicc[ai]=1-dicc[ai]
    else:
        dicc[ai]=1
        
icnt=0    
for i in dicc.values():
    icnt=icnt+i
      
print(icnt)

Submission status: Accepted

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

c = collections.Counter(A)

cnt = 0
for value in c.values():
    if(value%2 != 0):
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
A = set()

for _ in range(int(input())):
    i = int(input())
    if i in A:
        A.remove(i)
    else:
        A.add(i)
        
print(len(A))

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
d = defaultdict(int)
for j in nums:
  d[j] += 1
count = 0
for k in d.values():
  if k % 2 == 1:
    count += 1
print(count)

Submission status: Accepted

Solution code:
from collections import Counter, deque
# from copy import copy, deepcopy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
# from operator import xor
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():
    N=int(input())
    A=[int(input()) for i in range(N)]

    AA=Counter(A)
    cnt=0
    for i in AA.values():
        if i%2==1:
            cnt+=1

    print(cnt)

resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

P = set()
N = int(input())
for s in sys.stdin.readlines():
    n = int(s)
    if n in P:
        P.remove(n)
    else:
        P.add(n)

print(len(P))

Submission status: Accepted

Solution code:
from collections import defaultdict

cnt = defaultdict(int)

n = int(input())
for i in range(n):
    value = int(input())
    cnt[value] += 1

ret = 0
for c in cnt.values():
    if c % 2 == 1:
        ret += 1
print(ret)

Submission status: Accepted

Solution code:
N = int(input())
a_cnt = {}
for i in range(N):
    a = int(input())
    if a in a_cnt:
        a_cnt[a] += 1
    else:
        a_cnt[a] = 1

ans = 0
for a in a_cnt.values():
    if a % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
dict = {}
b = set(a)
for d in b:
    dict.update({d:0})
for c in a:
    dict[c]+=1
ans = 0
for d in b:
    if dict[d]%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter


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

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

    print(result)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

for val in A:
    if val in num:
        num.remove(val)
    else:
        num.add(val)
    #print(num)
print(len(num))

Submission status: Accepted

Solution code:
N = int(input())
C = {}
#A = [int(input()) for x in range(N)]

for i in range(N):
    a = int(input())
    if a in C:
        C[a] += 1
    else:
        C[a] = 1

print(len([1 for i in C.values() if i % 2 == 1]))

Submission status: Accepted

Solution code:
n = int(input())
key = dict()

for i in range(n):
  a = int(input())
  if a not in key:
    key[a] = 1
  elif key[a] == 1:
    key[a] = 0
  else:
    key[a] = 1

ans = 0
for value in key.values():
  ans += value
print(ans)

Submission status: Accepted

Solution code:
import collections

n = int(input())
a = [int(input()) for _ in range(n)]
c = dict(collections.Counter(a))

ans = 0

for _,val in c.items():
  if val % 2 == 1:
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
a = []
for i in range(N):
    inputs = int(input())
    a.append(inputs)
    
ans = dict(Counter(a))
ans1 = [kv[0] for kv in ans.items() if kv[1]%2==1]

print(len(ans1))

Submission status: Accepted

Solution code:
N = int(input())
dic = dict()
for j in range(N):
    i = int(input())

    if i not in dic.keys():
        dic[i] = 1
    else:
        if dic[i] == 0:
            dic[i] = 1
        else:
            dic[i] = 0



ans = sum(dic.values())

print(ans)

Submission status: Accepted

Solution code:
import sys

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

a.sort()

number = {}

for item in a:
    if item in number.keys():
        number[item] += 1
    else:
        number[item] = 1
    
cnt = 0
for i in number.values():
    if i % 2 != 0:
        cnt += 1

print("{}".format(cnt))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
import collections
b = collections.Counter(a)
set_a = list(set(a))
cnt = 0
for i in range(len(set_a)):
    if b[set_a[i]]%2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(inp())
A = [int(inp()) for _ in range(N)]

cnt = Counter(A)

ans = 0

for c in cnt.values():
    if c % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
def main():
    from collections import Counter
    n, *a = map(int, open(0).read().split())
    b = Counter(a)
    ans = sum(v%2==1 for v in b.values())
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(bool)
n = int(input())
for _ in range(n):
  i = input()
  d[i] = not d[i]
print(sum(1 for key in d if d[key]))

Submission status: Accepted

Solution code:
N = int(input())
s = [int(input()) for i in range(N)]

import collections
c = collections.Counter(s)

ans_lis = [x for x in list(c.values()) if x %2 != 0]
print(len(ans_lis))

Submission status: Accepted

Solution code:
N = int(input())
D = {}
for _ in range(N):
    A = int(input())
    D[A] = not D.get(A, False)
print(sum(D.values()))

Submission status: Accepted

Solution code:
import collections
s=int(input())
k = [input() for i in range(s)]
c = collections.Counter(k)
z=c.values()
lst=[ e for e in z if e%2==1]
print(len(lst))

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
d = dict()
for i in range(n):
    a = int(input())
    if a not in d:
        d[a] = 0
    d[a] += 1
da = list(d.values())
for i in range(len(da)):
    if da[i] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

N=int(input())
L=[]
for i in range(N):
	X=int(input())
	L.append(X)
M=Counter(L)
count=0
for i,j in M.items():
	if j%2==1:
		count+=1
print(count)

Submission status: Accepted

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

d = {}
for i in a:
    if i in d:
        if d[i] == 0:
            d[i] = 1
        else:
            d[i] = 0
    else:
        d[i] = 1

print(list(d.values()).count(1))

Submission status: Accepted

Solution code:
import sys
f=sys.stdin.readline
l=[f() for _ in range(int(f()))]
from collections import *
c=Counter(l)
print(sum(v%2 for v in c.values()))

Submission status: Accepted

Solution code:
l=[input() for _ in range(int(input()))]
from collections import *
c=Counter(l)
print(sum(v%2 for v in c.values()))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import Counter
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, A: "List[int]"):
    ctr = Counter(A)
    print(sum(1 for key in ctr.keys() if ctr[key] % 2 == 1))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

c = Counter(a)

#偶数回表れていれば消えている、奇数回であれば紙に掛かれている状態
ans = 0
for n, count in c.items():
  if count % 2 == 1:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

s = set()
for _ in range(n):
    num = int(input())
    if num in s:
        s.remove(num)
    else:
        s.add(num)
print(len(s))

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:
n = int(input())
l = [int(input()) for _ in range(n)]

from collections import Counter

x = 0
for i in Counter(l).values():
    if i%2 == 1:
        x += 1
print(x)

Submission status: Accepted

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


def solve():
    N = int(rline())
    counter = defaultdict(int)
    for _ in range(N):
        counter[int(rline())] += 1
    
    ans = 0
    for val in counter.values():
        if val % 2 == 1:
            ans += 1
    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
dic = {}
for i in a:
    if i not in dic:
        dic[i] = 1
    else:
        if dic[i] == 0:
            dic[i] = 1
        else:
            dic[i] = 0
ans = 0
for value in dic.values():
    if value == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

ab.sort()
memo = 1
ans = 0
for i in range(n):
    if i == n-1:
        ans += memo%2
    elif ab[i] == ab[i+1]:
        memo += 1
    else:
        ans += memo%2
        memo = 1
print(ans)

Submission status: Accepted

Solution code:
import collections

N = int(input())

A = []

for _ in range(N):
    A.append(int(input()))

count = collections.Counter(A)

ans = 0
for k in count:
    if count[k] % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n =int(input())
a =list(int(input()) for i in range(n))

dict = {}
for i in range(n):
  if str(a[i]) in dict:
    dict.pop(str(a[i]))
    continue
    
  if not(str(a[i]) in dict):
    dict[str(a[i])] =1
    continue
  
    
print(len(dict))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
l = [int(input()) for _ in range(n)]
c = Counter(l)
ans = 0
for key, value in c.items():
  if value % 2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
A = [int(input()) for _ in range(N)]
d = defaultdict(int)

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

ans = 0
for val in d.values():
  if val % 2 == 1:
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
A = [int(input()) for _ in range(N)]
d = defaultdict(int)

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

ans = 0
for key, val in d.items():
  if val % 2 == 1:
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
d = defaultdict(int)
cnt = 0

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

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

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
dic = {}
for i in range(n):
    a = str(input())
    try:
        dic[a]
        dic.pop(a)
    except:
        dic[a] = 0

print(len(dic))

Submission status: Accepted

Solution code:
def main():
  n=int(input())
  a=sorted([int(input()) for _ in [0]*n])
  a.append(0)
  a=tuple(a)
  cnt,x,ans=0,a[0],0
  for i in a:
    if x==i:
      cnt+=1
    else:
      ans+=1 if cnt%2==1 else 0
      cnt,x=1,i
  print(ans)
if __name__=='__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
c=collections.Counter()
N=int(input())
for i in range(N):
    c[int(input())]+=1
d=list(filter(lambda x:c[x]%2==1,c))
print(len(d))

Submission status: Accepted

Solution code:
import collections

n=int(input())
dic=collections.defaultdict(int)
for _ in range(n):
  tmp=int(input())
  dic[tmp]+=1
ans=0
for key in dic.keys():
  if dic[key]%2==1:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

A = Counter(a)

ans = sum([1 for x in A.values() if x % 2 != 0])
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
numbers={}
for n in range(0,N):
    number=int(input())
    if number in numbers:
        numbers[number]+=1
    else:
        numbers[number]=1
ans=0
for n in list(numbers.values()):
    ans+=n%2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = {}
ans = 0

for i in range(n):
  a = int(input())
  if a not in l:
    l[a] = 1
  else:
    l[a] += 1

for k in l.values():
  if k%2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

N = int(input())
A = []
for _ in range(N):
    a = int(input())
    A.append(a)
A.sort()

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

print(ans)

Submission status: Accepted

Solution code:
# coding:utf-8
import sys 
from collections import Counter
def main():
    n = int(input())
    a = list(map(int, [input() for i in range(n)]))
    a_count = Counter(a)
    ans = []

    for i in a_count.items():
        if i[1] % 2 != 0:
            ans.append(i[0])

    print(len(ans))
    
if __name__ == '__main__' :
    main()

Submission status: Accepted

Solution code:
#073C
from collections import Counter
n = int(input())
a = [0]*n
dic = dict()

for _ in range(n):
    a = int(input())
    dic.setdefault(a , 0)
    if dic[a] == 0:
        dic[a] = 1
    else:
        dic[a] -= 1
        
print(sum(dic.values()))

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
b = []
for i in range(0,n-1,2):
  if a[i] != a[i+1]:
    b.append(a[i])
    b.append(a[i+1])
  else:
    continue
if n%2 == 1:
  b.append(a[-1])
#print(b)
ans = []
if b != []:
  ans.append(b[0])
  for j in range(1,len(b)-1,2):
    if b[j] != b[j+1]:
      ans.append(b[j])
      ans.append(b[j+1])
  if len(b)%2 == 0:
    ans.append(b[-1])
#print(ans)
if ans == []:
  print(0)
else:
  print(len(ans))

Submission status: Accepted

Solution code:
n = int(input().strip())
a = [input().strip() for _ in range(n)]
dic = {}
for elem in a:
    if dic.get(elem):
        if dic[elem] == 0:
            dic[elem] = 1
        else:
            dic[elem] = 0
    else:
        dic[elem] = 1
print(len(list(filter(lambda x: x == 1, dic.values()))))

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())

nums = [int(input()) for i in range(N)]
    
c = Counter(nums)

cnt = 0
for k, v in c.items():
    if v % 2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#pypyは内包表記使わない
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N = int(input())
    a = []
    for _ in range(N):
        n = int(input())
        a.append(n)
    c = Counter(a)
    res = 0
    for i in c.values():
        if i%2:
            res += 1
    print(res)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
dic = {}
for i in range(N):
  A = int(input())
  if A not in dic:
    dic[A]=1
  else:
    dic[A]^=1
print(sum(dic.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

A={}
for i in range(N):
    a=int(input())
    if a in A.keys():
        A[a]+=1
    else:
        A[a]=1

cnt=0
for k,v in A.items():
    if v%2==1:
        cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())

A=[]
for i in range(N):
    A.append(int(input()))

from collections import Counter

AC=Counter(A)

cnt=0
for k,v in AC.items():
    if v%2==1:
        cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[int(input()) for i in range(n)]

c=Counter(a)
ans=0
for i in c.values():
    if i%2!=0:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
# Write and Erase
n = int(input())
a = {}
count = 0
for _ in range(n):
    elem = input()
    if elem not in a:
        a[elem] = 1
    else:
        a[elem] += 1
for i in a.values():
    count += i % 2
print(count)

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    n=int(readline())
    d={}
    for _ in range(n):
        a = readline().strip()
        if a in d:
            d[a]+=1
        else:
            d[a]=1
    cnt=0
    for key in d:
        if d[key]%2==1:
            cnt+=1
    print(cnt)
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  ans = {}
  for i in range(n):
    num = int(input())
    if num in ans:
      del ans[num]
    else:
      ans[num] = True
  count = len(ans)
  print(count)
  
def input_list():
  return map(int, input().split())

def input_list_str():
  return map(str, input().split())

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c 

import math
import fractions
from functools import reduce
main()