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

Solution (Python):
n=int(input())
ans = {}
printed = 0
for i in range(n):
  a = int(input())
  if not a in ans:
    ans[a] = 1
    printed += 1
  else:
    ans[a] += 1
    if ans[a] % 2 == 0:
      printed -= 1
    else:
      printed += 1
print(printed)

Solution (Python):
n = int(input())
al = []
for i in range(n):
    al.append(int(input()))

al.sort()
al.append(10**9+1)
cnt = 1
ans = 0
for j in range(n):
    if al[j] == al[j+1]:
        cnt += 1
    elif cnt%2 == 0:
        cnt = 1
    elif cnt%2 == 1:
        cnt = 1
        ans += 1
print(ans)

Solution (Python):
n = int(input())
A = {}
for i in range(n):
    a = int(input())
    A[a] = A.get(a, 0)+1
    A[a] %= 2
s = 0
for v in A.values():
    s += v
print(s)

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

Solution (Python):
N = int(input())
dic = {}

for i in range(N):
    a = int(input())
    
    if a not in dic:
        dic[a] = 1
    else:
        del dic[a]

print(len(dic))

Solution (Python):
import sys
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
from functools import partial, reduce
from collections import Counter


def f_chain(*args):
    return reduce(lambda x, f: f(x), args)

def main():
    n = II()
    aa = [II() for _ in range(n)]
    c_cnt = Counter(aa).values()
    f_chain(c_cnt,
            partial(map, lambda x: 1 if x%2==1 else 0),
            sum,
            print)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
from functools import partial, reduce
from collections import Counter

def f_chain(*args):
    return reduce(lambda x, f: f(x), args)
def is_odd(n):
    return n%2==1

def main():
    n = II()
    aa = [II() for _ in range(n)]
    c = Counter(aa)
    f_chain(c.values(),
            partial(filter, is_odd),
            list,
            len,
            print,
    )

if __name__ == '__main__':
    main()

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

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

Solution (Python):
N = int(input())
A = []
count = 1
ans = 0

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

A.sort()

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

print(ans)

Solution (Python):

"""
Created on Wed Sep 23 16:58:10 2020

@author: liang
"""


"""
【パディングはソート後】
"""
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
A += [-1]
ans = 0
count = 1
for i in range(N):
    
    if A[i] == A[i+1]:
        
        count += 1
    else:
        
        if count%2 == 1:
            ans += 1
        count = 1
print(ans)

Solution (Python):

"""
Created on Wed Sep 23 16:50:38 2020

@author: liang
"""
N = int(input())
d = dict()
ans = 0 
A = [int(input()) for _ in range(N)]
for a in A:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1

for key in d.keys():
    if d[key] %2 ==1:
        ans += 1
        d[key] = 0

print(ans)

Solution (Python):
n = int(input())
alst = [int(input()) for _ in range(n)]
alst.sort()
bef = -1
ans = 0
for a in alst:
  if a == bef:
    ans -= 1
    bef = -1
  else:
    ans += 1
    bef = a
print(ans)

Solution (Python):
from collections import defaultdict

d = defaultdict(int)

n = int(input())
for i in range(n):
  a = int(input())
  d[a] = int(not(d[a]))
ans=0
for k,v in d.items():
  if v == 1:
    ans += 1

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]
import collections
cnt = 0
b = collections.Counter(a)
for k in b:
    if b[k]%2==1:
        cnt +=1
print(cnt)

Solution (Python):
from collections import Counter

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

print(sum(c%2 for c in Counter(A).values()))

Solution (Python):

from collections import Counter

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

L = Counter(A)

print(sum( 1 for c in L.values() if c%2 ))

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

Solution (Python):
N = int(input())
memo = {}
for i in range(N):
    s = int(input())
    if s in memo:
        memo[s] += 1
    else:
        memo[s] = 1
ans = 0
for key, val in memo.items():
    if val%2:
        ans += 1
print(ans)

Solution (Python):



from math import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq














import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7


INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
n = I()
dic = defaultdict(int)
for i in range(n):
    a = I()
    dic[a] += 1
ans = 0
for k,v in dic.items():
    ans += v%2
print(ans)

Solution (Python):
from collections import Counter
print(sum(x % 2 for x in Counter([int(input())
                                  for _ in range(int(input()))]).values()))

Solution (Python):
from collections import defaultdict


N, *A = map(int, open(0).read().split())
ans = defaultdict(int)
for a in A:
    ans[a] += 1
print(sum(v % 2 for v in ans.values()))

Solution (Python):
from collections import defaultdict
d = defaultdict(int)
n = int(input())
for i in range(n):
    a = int(input())
    if d[a] > 0:
        d[a] -= 1
    else:
        d[a] += 1

ans = 0
for v in d.values():
    if v > 0:
        ans += 1
print(ans)

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

Solution (Python):
from collections import Counter

n = int(input())
al = list(int(input()) for _ in range(n))
c = Counter(al)
ans = 0
for k, v in c.items():
    if v%2 != 0:
        ans += 1

print(ans)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]
aset = set()
for x in a:
  if x not in aset:
    aset.add(x)
  else:
    aset.remove(x)
print(len(aset))

Solution (Python):
n = int(input())
A = [int(input()) for _ in range(n)]
S = set()
for a in A:
    if a in S:
        S.remove(a)
    else:
        S.add(a)
print(len(S))

Solution (Python):
from collections import Counter
n = int(input())
ans = 0
C = Counter(int(input()) for _ in range(n))
for c in C.values():
    if c % 2 == 1:
        ans += 1
print(ans)

Solution (Python):
import collections

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

ans= 0
Acount = collections.Counter(A)

for i in Acount:
    if Acount[i] % 2 == 1:
        ans += 1

print(ans)

Solution (Python):
N = int(input())
A = [0]*N

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

A.sort()

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

ans+=count%2

print(ans)

Solution (Python):
N = int(input())
S = set()
ans = 0
for i in range(N):
    a = int(input())
    if a in S:
        ans -= 1
        S.remove(a)
    else:
        ans += 1
        S.add(a)
print(ans)

Solution (Python):
n = int(input())
cnt_l = {}
for _ in range(n):
    a = int(input())
    if a in cnt_l:
        cnt_l[a] ^= 1
    else:
        cnt_l[a] = 1
print(sum(cnt_l.values()))

Solution (Python):
from collections import Counter

N = int(input())
A = [int(input()) for _ in range(N)]
CA = Counter(A)
ans = 0
for value in CA.values():
    if value % 2 == 1:
        ans += 1
print(ans)

Solution (Python):


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

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

print(ans)

Solution (Python):
n = int(input())

d = {}
for i in range(n):
    a = int(input())
    if a not in d:
        d[a] = 1
    else:
        if d[a]:
            d[a] = 0
        else:
            d[a] = 1

ans = 0
for v in d.values():
    ans += v
    
print(ans)

Solution (Python):
import collections

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

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

Solution (Python):
n = int(input())
kami = set()

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

print(len(kami))

Solution (Python):
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    n = i_input()
    dic = {}
    for i in range(n):
        a = i_input()
        dic[a] = dic.get(a,0) + 1

    ans = 0

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








if __name__=="__main__":
    main()

Solution (Python):
import collections
n = int(input())
alist = [int(input()) for i in range(n)]
cole = collections.Counter(alist)
count = 0
for i in cole.values():
  if i%2==1:
    count+=1
print(count)

Solution (Python):
n=int(input())
a=set()
for i in range(n):
  x=int(input())
  if x in a:
    a.discard(x)
  else:
    a.add(x)

print(len(a))

Solution (Python):
N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)

Solution (Python):
N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)

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

Solution (Python):
N=int(input())
A=[]
for n in range(N):
    A.append(int(input()))

A.sort()

cnt=1
ans=0
for n in range(1,N):
    if A[n]==A[n-1]:
        cnt+=1
    else:
        if cnt%2==1:
            ans+=1
        cnt=1
    if n==N-1 and cnt%2==1:
        ans+=1
print(ans)

Solution (Python):
from collections import Counter
with open(0) as f:
    N, *A = map(int, f.read().split())
ans = sum(1 for v in Counter(A).values() if v&1)
print(ans)

Solution (Python):
N=int(input())
A=dict()
for _ in range(N):
    a=int(input())
    if a not in A:
        A[a]=0
    A[a]=1-A[a]
print(sum(A.values()))

Solution (Python):
import collections
n = int(input())
l = list(int(input()) for i in range(n))
d = collections.Counter(l)
ans = 0
for v in d.values():
  ans += v % 2
print(ans)

Solution (Python):
N = int(input())
d = {}
for i in range(N):
  a = int(input())
  d[a] = d.get(a, 0) ^ 1
x = sorted(d.values())
print(sum(x))

Solution (Python):
from collections import defaultdict
n = int(input())
li = []
s = set()
for val in range(n):
    i = int(input())
    if i in s:
        s.remove(i)
    else:
        s.add(i)

print(len(s))

Solution (Python):
N = int(input())
S = set()
for _ in range(N):
  a = int(input())
  if a in S:
    S.remove(a)
  else:
    S.add(a)
    
print(len(S))

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

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(N)]

dic = {}

for i in range(N):
  if A[i] in dic.keys():
    dic[A[i]] += 1
  else:
    dic[A[i]] = 1
    
cnt = 0

for j in dic.keys():
  if dic[j] % 2 == 1:
    cnt += 1
    
print(cnt)

Solution (Python):
import collections
n = int(input())
aa = [int(input()) for a in range(n)]

caa = collections.Counter(aa) 
cnt = 0
laa = [x[1] for x in caa.items()]
for la in laa:
  if la % 2 == 1:
    cnt += 1
print(cnt)

Solution (Python):
n = int(input())
A = [int(input()) for _ in range(n)]
a = sorted(A)
i = 0
ans = 0
while i < n:
    if i == 0:
        if a[0] == a[1]:
            cnt = 2
            i = 2
            while i < n and a[i-1] == a[i]:
                cnt += 1
                i += 1
            ans += cnt%2
        else:
            ans += 1
            cnt = 1
            i = 2
            while i < n and a[i-1] == a[i]:
                cnt += 1
                i += 1
            ans += cnt%2
    else:
        cnt = 1
        i += 1
        while i < n and a[i-1] == a[i]:
            cnt += 1
            i += 1
        ans += cnt%2
print(ans)

Solution (Python):
from collections import Counter

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

l=Counter(l)

cnt=0

for i in l.values():
  if i%2==0:
    cnt+=1
    
print(len(l)-cnt)

Solution (Python):
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
a=sorted(a)
ans=0
cnt=1
for i in range(n-1):

    if a[i]==a[i+1]:
        cnt+=1
    else:
        if cnt%2==1:ans+=1
        cnt=1
if cnt%2==1:ans+=1
print(ans)

Solution (Python):
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
a=sorted(a)
ans=0
cnt=1
for i in range(n-1):

    if a[i]==a[i+1]:
        cnt+=1
    else:
        if cnt%2==1:ans+=1
        cnt=1
if cnt%2==1:ans+=1
print(ans)

Solution (Python):
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right 
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
MOD = 10**9+7

def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)

N = int(input())
A = dict()
for _ in range(N):
    a = int(input())
    A.setdefault(a,0)
    A[a] += 1
ans = 0
for a in A:
    ans += A[a]%2!=0
print(ans)

Solution (Python):
N = int(input())
paper = set()
A = 0
for _ in range(N):
    A = int(input())
    if A in paper:
        paper.discard(A)
    else:
        paper.add(A)
print(len(paper))

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

Solution (Python):
n = int(input())
paper = dict()
for i in range(n):
    a = int(input())
    if a not in paper:
        paper[a] = 1
    else:
        paper.pop(a)

res = 0
for value in paper.values():
    if value == 1:
        res += 1
print(res)

Solution (Python):
import sys
mod=10**9+7 ; inf=float("inf")
from math import sqrt, ceil
from collections import deque, Counter, defaultdict 
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import ROUND_HALF_UP,Decimal  
  
from functools import lru_cache
from bisect import bisect_left as bileft, bisect_right as biright






n=int(input())
A=[int(input()) for i in range(n)]
C=Counter(A)
print(len([i for i in C.values() if i%2==1]))

Solution (Python):
N = int(input())
num = {}
for i in range(N):
    A = int(input())
    if A in num.keys():
        num[A] += 1
    else:
        num[A] = 1
ans = 0
for i, j in num.items():
    if j%2 == 1:
        ans += 1
print(ans)

Solution (Python):
n=int(input())
a={}
for i in range(n):
  a_=int(input())
  if a_ not in a:
    a[a_]=1
  else:
    a[a_]+=1
ans=0
for i in a:
  if a[i]%2==1:
    ans+=1
print(ans)

Solution (Python):
N, *A = map(int, open(0).read().split())

import collections

c = collections.Counter(A)

print(sum([1 for x in c.values() if x%2==1]))

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

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

print(ans)

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

import collections

ans = 0
lis = collections.Counter(lis)

for i in lis.values():
    if i%2 == 1:
        ans += 1

print(ans)

Solution (Python):
def main():
    n = int(input())
    a = set()
    for i in range(n):
        m = input()
        if m in a:
            a.remove(m)
        else:
            a.add(m)
    print(len(a))


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
nums = {}
for i in range(N):
    n = int(input())
    if n in nums.keys():
        nums[n] += 1
    else:
        nums[n]=1
c = 0
for te in nums.values():
   if te % 2 == 1:
       c+=1
print(c)

Solution (Python):



def main():
    n = int(input())
    a = set()
    for i in range(n):
        m = input()
        if m in a:
            a.remove(m)
        else:
            a.add(m)
    print(len(a))


if __name__ == "__main__":
    main()

Solution (Python):
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))

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

Solution (Python):
n = int(input())
a = []

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

a = sorted(a)

hoge = 0
foo = 0
ans = 0

for i in range(n):
    if i == 0:
        foo = a[i]
        hoge = 1
    elif i == n-1:
        if foo != a[i]:
            if hoge == 1:
                ans += 1
            ans += 1
        else:
            if hoge == 0:
                ans += 1
    elif foo == a[i]:
        hoge = 1-hoge
    else:
        if hoge == 1:
            ans += 1
        foo = a[i]
        hoge = 1

print(ans)

Solution (Python):
n=int(input())
d=dict()
for _ in range(n):
    hoge=int(input())
    if d.get(hoge,0)==0:
        d[hoge]=1
    else:
        d[hoge]+=1
ans=0
for i in d.values():
    if i%2==1:
        ans+=1
print(ans)

Solution (Python):
import collections
N=int(input())
A=[]

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

cc=collections.Counter(A)
ans=0
for nums in list(cc.values()):
    if nums%2==1:
        ans+=1
print(ans)

Solution (Python):
def main():
    n = int(input())
    a_lst = [int(input()) for _ in range(n)]
    a_lst.sort()

    count = 0
    tmp = 0
    number = a_lst[0]

    for i in range(n):

        if a_lst[i] == number:
            tmp += 1

            if i == n - 1:
                if tmp % 2 != 0:
                    count += 1

        else:
            number = a_lst[i]

            if tmp % 2 == 0:
                tmp = 1
                continue
            else:
                count += 1
                tmp = 1

    if n > 1:
        if a_lst[-1] != a_lst[-2]:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    from collections import Counter    
    return sum(map(lambda x: x%2==1, Counter(A).values()))


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

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):
N = int(input())
al = [int(input()) for _ in range(N)]

num_dic = {}
for a in al:
    num = num_dic.get(a, 0)
    num_dic[a] = 1 if num == 0 else 0

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

print(ans)

Solution (Python):
N = int(input())
ans = {}
for i in range(N):
    A = input()
    if  A in ans:
        ans[A] += 1
    else:
        ans[A] = 1
c = 0
for i in ans:
    if ans[i] % 2 == 1:
        c += 1
print(c)

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

n = int(input())

a = []

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

a.sort()

i = 0
ans = 0
while i < n:
    num = 1
    i += 1
    while i < n and a[i] == a[i-1]:
        num += 1
        i += 1
    if num % 2 == 1:
        ans += 1

print(ans)

Solution (Python):
n = int(input())
a = set()
for i in range(n):
  tmp = int(input())
  if tmp in a: a.discard(tmp)
  else: a.add(tmp)
print(len(a))

Solution (Python):
n = int(input())
sum = 0
nums = {}

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

for i in nums.values():
    sum += i % 2

print(sum)

Solution (Python):
n=int(input())

count_dict={}

for i in range(n):
    new=int(input())
    if new in count_dict:
        count_dict[new]+=1
    else:
        count_dict[new]=1
ans=0
for i in count_dict.values():
    if i%2==1:
        ans+=1
print(ans)

Solution (Python):
import collections
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
    
cnt = collections.Counter(A)
ans = 0
for v in cnt.values():
    if v % 2 != 0:
        ans += 1
        
print(ans)

Solution (Python):
import sys
import collections

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def main():
	n = int(input())
	
	
	dd=collections.defaultdict(lambda :0)
	for _ in range(n):
		v = int(input())
		dd[v] += 1
	
	ret = 0
	for k in dd:
		if dd[k] % 2 == 1:
			ret += 1
	print(ret)
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
import collections 
N = int(input())
lsA = []
for i in range(N):
    lsA.append(int(input()))
counterA = collections.Counter(lsA)
ans = 0
for i in counterA.values():
    ans += i%2
print(ans)

Solution (Python):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial

from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

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

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

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input()) for _ in range(n) ]

ddict = defaultdict(lambda: 0)





n = I()
a = CI(n)

for i in range(n):
    ddict[a[i]] += 1

    
ans = 0
for t in ddict.items():
    m = t[0]
    c = t[1]
    if c%2==0:
        pass
    else:
        ans += 1
print(ans)

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
cnt = 0
for v in collections.Counter([ri() for _ in range(n)]).values():
    if v&1:
        cnt += 1
print(cnt)

Solution (Python):
n = int(input())
a = list()
for i in range(n):
    a.append(int(input()))
import collections
b = collections.Counter(a)
c = list(map(lambda x: x%2, list(b.values())))
print(c.count(1))

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

i = 0
ans = 0
while i < N:
    tmp = A[i]
    count = 0
    while i < N and A[i] == tmp:
        count += 1
        i += 1
    ans += count % 2

print(ans)

Solution (Python):

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

paper = set()
for a in A:
    if not(a in paper):
        paper.add(a)
    else:
        paper.remove(a)
print(len(paper))

Solution (Python):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
jud = 1
q = a[0]
ans = 0
for i in range(1,n):
  if(q==a[i]):
    jud += 1
  else: 
    if(jud%2==1):
      ans += 1
    jud = 1
    q = a[i]
if (jud%2==1):
  ans += 1
if(n==1):
  ans = 1
print(ans)

Solution (Python):
from collections import  Counter

n = int(input())
A = [int(input()) for _ in range(n)]
cnt_A = Counter(A)

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

Solution (Python):
def main():
    n = int(input())
    ans = set()
    for _ in range(n):
        a = int(input())
        if a in ans:
            ans.discard(a)
        else:
            ans.add(a)

    print(len(ans))


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = int(input())
    ans = set()
    for _ in range(n):
        a = int(input())
        if a in ans:
            ans.discard(a)
        else:
            ans.add(a)

    print(len(ans))


if __name__ == "__main__":
    main()

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

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(N)]

d = {}

for i in A:
    d[i]=0

for i in A:
    if d[i]==1:
        d[i]=0
    else:
        d[i]=1
    
print(sum(d.values()))

Solution (Python):


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

d = {}
for i in range(n):
    if a[i] not in d:
        d[a[i]] = 1 
    else:
        d[a[i]] += 1

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

print(ans)

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

from collections import Counter
c = Counter(A)
cc = list(c.values())
ans = 0
for i in range(len(cc)):
    if cc[i] % 2 == 1:
        ans += 1

print(ans)

Solution (Python):
from collections import *
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
d=defaultdict(int)
for i in l:
    d[i]+=1
c=0
for i in d:
    if(d[i]%2==1):
        c=c+1
print(c)

Solution (Python):
import collections
import numpy as np
n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
ans = collections.Counter(a)
c=list(ans.values())
c=np.array(c)
print(sum(c%2))

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

Solution (Python):
import collections
a = int(input())
s = [input() for i in range(a)]
c = collections.Counter(s)
b = []
for myvalue in c.values():
    b.append(myvalue)

d = len(b)
ans = int(0)
for i in range(int(d)):
    if b[i] % 2 == 0:
        pass
    else:
        ans += 1
        
print(ans)

Solution (Python):
n=int(input())
d={}
for i in range(n):
  A=int(input())
  if A not in d:
    d[A]=1
  elif d[A]==1:
    d[A]=0
  else:
    d[A]=1
print(sum(d.values()))

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(N)]

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

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    dic = collections.defaultdict(int)
    ans = 0
    for _ in range(n):
        a = I()
        dic[a] += 1
    for key,value in dic.items():
        if value%2 == 1:
            ans += 1
    print(ans)
main()

Solution (Python):
import collections
a=int(input())
b=[int(input()) for i in range(a)]

n=collections.Counter(b)
m,ans=zip(*n.most_common())
ans=[i for i in ans if i%2==1]
print(len(ans))