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())
lis = set()
for i in range(n):
    a = int(input())
    if a not in lis:lis.add(a)
    else:lis.remove(a)
print(len(lis))

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
A = defaultdict(int)

for _ 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:
#!/usr/bin/env 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))

Submission status: Accepted

Solution code:
d = {}
N = int(input())
for _ in range(N):
    a = int(input())
    if a not in d:
        d[a] = True
    else:
        d.pop(a)
print(len(d))

Submission status: Accepted

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

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

print len(S)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
A = set()
for i in range(N):
    num = input()
    if num in A:
        A.remove(num)
    else:
        A.add(num)
print(len(A))

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# Set 2 dimension list
def dim2input(N):
    li = []
    for _ in range(N):
        li.append(input().split())
    return li

# --------------------------------------------

dp = None

def main():
    N = int(input())
    D = collections.defaultdict(lambda: 0)
    ans = 0

    for _ in range(N):
        D[input()] += 1

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

    print(ans)

main()

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input())for i in range(n)]
import collections
data=collections.Counter(a)
ans=[]
for i,j in data.items():
    if j%2==1:
        ans.append(i)
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
dic = {}
for i in range(n):
    a = input()
    if a in dic:
        del dic[a]
    else:
        dic[a] = None
print(len(dic))

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
dic = {}
for i in range(n):
    if a[i] in dic:
        del dic[a[i]]
    else:
        dic[a[i]] = None
print(len(dic))

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    B = set()
    for _ in range(n):
        b = int(input())
        if b in B:
            B.remove(b)
        else:
            B.add(b)
    print(len(B))
            

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

print(len(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
nums = {}
for i in range(N):
    A = int(input())
    nums.setdefault(A, 0)
    nums[A] += 1

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = set([])
for i in range(N):
    st = input()
    if set([st]) <= S:
        S -= set([st])
    else:
        S.add(st)

print(len(S))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from collections import defaultdict
N = int(input())
D = defaultdict(lambda: 0)
for _ in range(N):
    D[int(input())] += 1

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from collections import Counter
N = int(input())
A = [int(input()) for i in range(N)]
C = Counter(A)
res = 0
for k, v in C.items():
    if v%2 == 1:
        res += 1
print(res)

Submission status: Accepted

Solution code:
s = set()
N = int(input())
for _ in range(N):
    x = int(input())
    if x in s:
        s.remove(x)
    else:
        s.add(x)
print(len(s))

Submission status: Accepted

Solution code:
from collections import Counter

count = int(raw_input())
k = [int(raw_input()) for i in xrange(count)]
temp = Counter(k)
counter = 0
for key, value in temp.iteritems():
    if value % 2 != 0:
        counter += 1

print counter

Submission status: Accepted

Solution code:
n = int(input())

s = set()

for _ in range(n):
    k = int(input())
    if k in s: s.discard(k)
    else: s.add(k)

print(len(s))

Submission status: Accepted

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

print(len(A))

Submission status: Accepted

Solution code:
field = {}
a = [int(input()) for x in range(int(input()))]


for i in a:
  tmp = field.get(i)
  if not tmp:
    field[i] = True
  else:
    field[i] = False
print(sum(field.values()))

Submission status: Accepted

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

for x in range(n):
  i = int(input())
  if (i in di.keys()):
    di.pop(i)
  else:
    di[i] = i
print(len(di))

Submission status: Accepted

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


print(len(s))

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 10:03:26 2017

@author: kotania
"""
from collections import Counter

N = int(input())
 
AList = []
 
for n in range(0,N):
    AList.append(input())
    
countDict = Counter(AList)
countDictValues = countDict.values()

count = 0

for c in countDictValues:
    if c % 2 == 1 :
        count += 1

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 10:03:26 2017

@author: kotania
"""
from collections import Counter

N = int(input())
 
AList = []
 
count = 0
        
for n in range(0,N):
    AList.append(input())
    
countDict = Counter(AList)
countDictValues = countDict.values()

count = 0

for c in countDictValues:
    if c % 2 == 1 :
        count += 1

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8

from collections import Counter

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

c = Counter(li)

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

Submission status: Accepted

Solution code:
import collections

cnt = int(input())
array = []
for i in range(cnt):
    array.append(int(input()))
cnt_dict = collections.Counter(array)

res = 0
for j in cnt_dict.values():
    if j % 2 != 0:
        res += 1
print(res)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

A = []

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

A.sort()

ans = 0
key = A[0]
cnt = 1

for i in range(1,N):
    if key == A[i]:
        if cnt == 0:
            cnt = 1
        else:
            cnt = 0
    else:
        key = A[i]
        ans += cnt
        cnt = 1

ans += cnt

print(ans)

Submission status: Accepted

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

def main():
    N = int(input())

    memo = {}
    for _ in range(N):
        num = int(input())
        if not num in memo:
            memo[num] = 1
        else:
            memo[num] ^= 1

    result = 0
    for value in memo.values():
        result += value
    print(result)
        

if __name__ == '__main__':
    main()

Submission status: Accepted

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

res=0
for x in s.values():
	res += x % 2

print(res)

Submission status: Accepted

Solution code:
N = int(input())
num = [False for i in range(N+1)]

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

ans = 0
prev = 0
num_sum=0
for Ai in A:
    if prev==Ai:
        num_sum+=1
    else:
        ans+=num_sum%2
        num_sum=1
    prev=Ai

print(ans)

Submission status: Accepted

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

res=0
for key,value in s.items():
#	print(key,value)
	res += (1 if not value % 2 == 0 else 0)

print(res)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(raw_input())
lis = []
for i in xrange(N):
	lis.append(int(raw_input()))
lis.sort()
lister = dict(Counter(lis)).items()
count = 0
for item in lister:
	if item[1] % 2 == 1:
		count += 1
print count

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(n):
	s = int(input())
	a.append(s)
a.sort()
a.append(0)
length = 0
i = 0
while i < n:
	counter = 1
	count = 0
	for k in range(i+1,n+1):
		if a[i] != a[k] and counter%2 == 1:
			length += 1
			i = i+count+1
			break
		elif a[i] != a[k] and counter%2 == 0:
			i = i+count+1
			break
		elif a[i] == a[k]:
			counter += 1
			count += 1
print(length)

Submission status: Accepted

Solution code:
import collections

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

value = list(collections.Counter(M).values())

sum = 0
for i in value:
    sum += i%2

print(sum)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-       
from collections import Counter

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

cnt = Counter(a)
ans = 0
for i in cnt:
    ans += cnt[i]%2
print(ans)

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:
n = input()
d = {}
for x in xrange(n):
    temp = input()
    try:
        d[temp] = (d[temp] + 1) % 2
    except:
        d[temp] = 1
print sum(d.values())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
A = Ap

#d = {1:2, 3:5, 6:10, 1000043:3814}
#zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)

n=input()<<A>>int
memo = {}
for i in range(n):
    x = input()<<A>>int
    if x in memo:
        memo[x] += 1
    else:
        memo[x] = 1;

ret = 0
for x in memo.values():
    ret += x % 2

print(ret)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
if N == 0:
	print('0')
	sys.exit()

numList = list()

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

wordCount = 0
i = 0

while i < N:
	if i < N-1 and numList[i] == numList[i+1]:
		i += 2
	elif i == N-1:
		wordCount += 1
		break
	else:
		wordCount += 1
		i += 1
		
print(wordCount)

Submission status: Accepted

Solution code:
from collections import defaultdict 

N = int(raw_input())
d = defaultdict(int)
for i in xrange(N):
    A = int(raw_input())
    d[A] = (d[A] + 1) % 2
ans = 0
for v in d.values():
    ans += v
print ans

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
 
sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**10
mod = 10**9+7
 
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
 
 
def main():
    n = I()
    s = set()
    for _ in range(n):
        a = I()
        if a in s:
            s.remove(a)
        else:
            s.add(a)
 
    return len(s)
 
print(main())

Submission status: Accepted

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

count = 1
oddA = []
for i in range(len(sortedA)):
    if i+1==len(sortedA):
        if count%2==1:
            oddA.append(sortedA[i])
        count = 1
    else:
        if sortedA[i]==sortedA[i+1]:
            count += 1
        else:
            if count%2==1:
                oddA.append(sortedA[i])
            count = 1

print(len(oddA))

Submission status: Accepted

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

m=0
count=[0 for i in range(n)]
count[m]=1

ans_count=0
a.sort()

for i in range(n-1):
    if a[m]==a[i+1]:
        count[m]=count[m]+1
    else:
        m=i+1
        count[m]=1

for i in range(n):
     ans_count=ans_count+count[i]%2

print(ans_count)

Submission status: Accepted

Solution code:
#!/usr/bin/python3

n = int(input())

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

t = 0
for i in num.keys():
    if num[i] % 2:
        t += 1

print(t)

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
tell_list = [input() for _ in range(N)]
count = 0
tell_count = Counter(tell_list)
for num in tell_count.most_common():
    count += num[1] % 2
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import Counter
import numpy as np
n = int(input())
a_list = []
for _ in range(n):
    a_list.append(int(input()))

counter = Counter(a_list)
count = list(counter.values())
ar = np.array(count)
ar = ar % 2
print(ar.sum())

Submission status: Accepted

Solution code:
import collections

N = int(input())
l = []
for i in range(N):
    l.append(int(input()))
count = collections.Counter(l)
total = 0
for k,v in count.items():
    if v % 2 == 0:
        pass
    else:
        total += 1
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

a.sort() 

cnt2 = 0
cnt = 1
ans = 0
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        cnt += 1
    else:
        ans += cnt%2
        cnt = 1
        flg = False

ans += cnt%2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
buff=[]
ans=1
for i in range(n):
    buff.append(input())

a=sorted(buff)

for i in range(1,n):
    if a[i] == a[i-1]:
        a[i-1]= -1
        a[i]= -1
        if ans>0:
            ans -= 1
    else:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

p = set()
for i in range(N):
    A = input()
    p ^= {A}

print(len(p))

Submission status: Accepted

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

a_list = {}

ans = 0

for i in range(N):
    a = input()
    a = int(a)
    if a not in a_list:
        a_list[a] = 1
    else:
        a_list[a] = (a_list[a] + 1) % 2
    if a_list[a]:
        ans += 1
    else:
        ans -= 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
array = []
d = {}
for tmp in range(N):
    a = int(input())
    array.append(a)
    if a not in d:
        d[a] = 1
    else:
        d[a] += 1
array = list(set(array))
for tmp in range(len(array)):
    if d[array[tmp]]%2 == 1:
        ans += 1
    else:
        pass
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
a = [input() for i in range(N)]
b = Counter(a).most_common()
count = 0
for i in range(len(b)):
    if b[i][1]%2 != 0:
        count+=1;

print(count)

Submission status: Accepted

Solution code:
N = int(input())
ret = set()
for _ in range(N):
    a = int(input())
    if a in ret:
        ret.remove(a)
    else:
        ret.add(a)

print(len(ret))

Submission status: Accepted

Solution code:
from collections import defaultdict

def solve():
    dic = defaultdict(int)
    n = int(input())
    ans = 0
    for _ in range(n):
        a = int(input())
        dic[a] = (dic[a] + 1) % 2
    print(sum(dic.values()))

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def Write_and_Erase():

    numbers = []
    try:
        LOCAL_FLAG
        N = 3
        numbers = [6, 2, 6]
        # N = 4
        # numbers = [2, 5, 5, 2]
        N = 6
        numbers = [12, 22, 16, 22, 18, 12]

    except NameError:
        N = int(input())
        for i in range(N):
            numbers.append(int(input()))

    onPaper = set([numbers[0]])
    for i in range(1, N):
        if numbers[i] in onPaper:
            onPaper.remove(numbers[i])
        else:
            onPaper.add(numbers[i])

    # print(onPaper)
    print(len(onPaper))


Write_and_Erase()

Submission status: Accepted

Solution code:
dict = {}
N = int(raw_input())
for i in range(0,N):
 j = raw_input()
 try:
  del dict[j]
 except:
  dict[j]=1
print len(dict)

Submission status: Accepted

Solution code:
n = int(input().strip())

d = {}
for _ in range(n):
    a = int(input().strip())
    d[a] = not d.get(a, False)
total = 0
for v in d.values():
    if v:
        total += 1
print(total)

Submission status: Accepted

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

for _ in range(n):
    a = int(input())

    if a in l:
        l.remove(a)
    else:
        l.add(a)

print(len(l))

Submission status: Accepted

Solution code:
import sys

data = set()
N = int(sys.stdin.readline())

for i in range(N):
    num = int(sys.stdin.readline())
    if num in data:
        data.remove(num)
    else:
        data.add(num)
print(len(data))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = raw_input()
N = int(N)

a = {}
for i in range(N):
	s_input = raw_input()
	if s_input in a:
		del a[s_input]
	else:
		a[s_input] = s_input

print(len(a))

Submission status: Accepted

Solution code:
n=int(raw_input())
li={}
while n !=0:
    a = raw_input()
    if a in li:
        del li[a]
    else:
        li[a]=a
    n-=1
print(len(li))

Submission status: Accepted

Solution code:
import collections as cl
import numpy as np

# デバッグ用
DEBUG = False
#DEBUG = True

# 宣言
result = 0
A = []
ELEM_MAX = 10000

# 入力部
if DEBUG:
    N = '10'
    a = '1 2 3 4 5'

else:
    N = int(input())

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

# 処理部
A_counter = cl.Counter(A)
for val in A_counter.values():
    result += val % 2

# 出力部
print(result)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())

a = np.zeros(n, dtype = int)

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

a = np.sort(a)

sum = 0
for i in range(n):
    if(i == 0):
        flag = 1
    elif(a[i - 1] == a[i]):
        flag += 1
    else:
        if(flag % 2 == 1):
            sum += 1
        else:
            flag = 1

if(flag % 2 == 1):
    sum += 1

print(sum)

Submission status: Accepted

Solution code:
from collections import Counter

def main():
    N = int(input())
    A = []

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

    ans = 0
    counter = Counter(A)
    for _, cnt in counter.most_common():
        if cnt % 2 == 1:
            ans += 1

    print(ans)
    
main()

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
A = []

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

ans = 0
counter = Counter(A)
for _, cnt in counter.most_common():
    if cnt % 2 == 1:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

A = set()

for _ 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:
n=input()
s={}
for i in range(n):
    tmp=input()
    if tmp in s:
        del s[tmp]
    else:
        s[tmp]=1
print len(s)

Submission status: Accepted

Solution code:
N = input()
D = {}
for i in range(N):
    a = input()
    if not a in D:
        D[a] = 0
    D[a] = (D[a] + 1) % 2
print sum(D.values())

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

print(len(nums))

Submission status: Accepted

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

dict2 = {}
for i in list1:
    if(i in dict2):
        dict2[i] += 1
    else:
        dict2[i] = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


def main():
    N = int(input())
    c = Counter([int(input()) for _ in range(N)])
    ans = 0
    for k, v in c.items():
        ans += v % 2 != 0
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import defaultdict, deque

d = defaultdict(int)

n = int(input())

count = 0
for i in range(n):
    a = int(input())
    if d[a] == 1:
        count = max(count - 1, 0)
        d[a] = 0
    else:
        d[a] = 1
        count += 1

print(count)

Submission status: Accepted

Solution code:
from collections import Counter

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

ans = 0
c = Counter(A)
for x in c:
    if c[x] % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#ABC073C
import sys

n=int(raw_input())
dic={}
for i in xrange(n):
 a=int(raw_input())
 if a in dic:
  dic[a]^=1
 else:
  dic[a]=1

res=0
for i in dic:
 if dic[i]==1:
  res+=1
print res

Submission status: Accepted

Solution code:
N = int(input())
A = dict()
ans = 0
for i in range(N):
    a = int(input())
    if a not in A or A[a] == False:
        A[a] = True
        ans += 1
    elif A[a]:
        A[a] = False
        ans -= 1

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
N=input()
x=[]
dict={}
for i in range(N):
    a=raw_input()
    if a in dict:
        if dict[a]==1:
            dict[a]=0
        else:
            dict[a]=1
    else:
        dict[a]=1

print np.sum(np.array(dict.values())%2)

Submission status: Accepted

Solution code:
import numpy as np
from collections import Counter
n = int(input())
num_l=[input() for i in range(n)]
ndarr=np.array(list(Counter(num_l).values()))
print(len(ndarr[ndarr%2 != 0]))

Submission status: Accepted

Solution code:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
A.sort()
ans = 0
cnt = 1
for i in range(1, N):
    if A[i] == A[i-1]:
        cnt += 1
    else:
        ans += cnt%2
        cnt = 1
ans += cnt%2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
seq = {}

for i in range(N):
    a = input()
    try:
        seq[a] = (seq[a] + 1) % 2
    except KeyError:
        seq[a] = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

l = []

for i in range(N):
    l.append(input())

l.sort()

ptr = 0
res = 0
while ptr < N:
    cc = l[ptr]
    f = 0
    while (ptr < N and l[ptr] == cc):
        f += 1
        ptr += 1
    res += f%2

print res

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
nums = set()
for _ in range(N):
    A = int(input())
    if A in nums:
        ans -= 1
        nums.remove(A)
    else:
        ans += 1
        nums.add(A)
print(ans)

Submission status: Accepted

Solution code:
times = int(raw_input())
numbers = {}
result = 0

for x in xrange(times):
    number = int(raw_input())
    if number not in numbers:
        numbers[number] = 0
    numbers[number] += 1

for item in numbers:
    if numbers[item] % 2 != 0:
        result += 1

print result

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)
n = int(raw_input())
for _ in range(n):
    d[int(raw_input())] += 1
print len(filter(lambda x: x % 2 == 1, d.values()))

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)
n = int(raw_input())
for _ in range(n):
    d[int(raw_input())] += 1
c = 0
for v in d.values():
    if v % 2 == 1:
        c += 1
print c

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
c=Counter([ input() for _ in range(N) ])
print(len([ 1 for k in c.keys() if c[k]%2==1]))

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for i in range(N)]
A.sort()
i=0
ans=0
while i<N:
  p=A[i]
  count=0
  for j in range(i,N):
    if A[j]==A[i]:
      count+=1
    else:
      break
  if count%2==1: ans+=1
  i+=count
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

N=int(input())

A=[]

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

C=Counter(A)

D=C.values()

cnt = 0

for x in D:
    if x%2!=0:
        cnt += 1
    else:
        pass
    
print(cnt)

Submission status: Accepted

Solution code:
from collections import defaultdict

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

print(len(list(filter(lambda x: x & 1, cnt.values()))))

Submission status: Accepted

Solution code:
n = int(input())
pool = []
ans = 0
for i in range(n):
    a = int(input())
    pool.append(a)
pool.sort()

ptr = 0
while ptr < len(pool):
    cc = pool[ptr]
    f = 0
    while ptr < len(pool) and pool[ptr] == cc:
        ptr += 1
        f += 1
    ans += f%2
print(ans)

Submission status: Accepted

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

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