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:
# coding: utf-8
dic = {}
for i in range(int(input())):
    s = input()
    if s in dic:
        dic[s] = (dic[s] + 1) % 2
    else:
        dic[s] = 1
ans = 0
for n in dic.items():
    if n[1] == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for i in range(n)]
 
B = set()
lenB = 0
for a in A:
    if a in B:
        B.remove(a)
        lenB -= 1
    else:
        B.add(a)
        lenB += 1
print(lenB)

Submission status: Accepted

Solution code:
from collections import defaultdict


def main():
    d = defaultdict(lambda: 0)
    n = int(input())
    for _ in range(n):
        a = input()
        d[a] += 1

    cnt = 0
    for key, value in sorted(d.items(), key=lambda x: x[1]):
        if value%2 == 1:
            cnt += 1
    print(cnt)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())

P=set()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ary = []
for _ in range(n):
  ary.append(int(input()))
 
ary.sort()
last = -1
counter = 0
result = 0
 
for i, el in enumerate(ary):
  if last == el:
    # count the same numbers
    counter += 1

  else:
    # increment
    result += counter%2
    
    # initialize
    counter = 1
    last = el

else:
    if i == n-1:
      result += counter%2
 
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
evole = set()
ans = 0
for i in range(n):
    var = int(input())
    if var in evole:
        evole.remove(var)
        ans -= 1
    else:
        evole.add(var)
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
d={}
for i in range(input()):a=input();d[a]=d.get(a,0)+1
print len(filter(lambda x:x%2,map(lambda x:d[x],d)))

Submission status: Accepted

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

dic={}
for i in A:
    dic[i] = dic.get(i,0) ^ 1

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

Submission status: Accepted

Solution code:
s = {}
for _ in range(int(input())):
    x = int(input())
    if x in s:
        s[x] ^= 1
    else:
        s[x] = 1
print(sum(1 if x == 1 else 0 for x in s.values()))

Submission status: Accepted

Solution code:
d={}
for i in range(input()):a=input();d[a]=d.get(a,0)+1
print len(filter(lambda x:x%2,map(lambda x:d[x],d)))

Submission status: Accepted

Solution code:
d = {}
for i in range(input()):
  a = input()
  d[a] = d.get(a, 0) + 1

print len(filter(lambda x: x % 2, map(lambda x: d[x], d)))

Submission status: Accepted

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

Submission status: Accepted

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

print(len(buff))

Submission status: Accepted

Solution code:
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 = {}
for i in range(input()):
  a = input()
  try:
    d[a] += 1
  except KeyError:
    d[a] = 1

print len(filter(lambda x: x % 2, map(lambda x: d[x], d)))

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 = input()
d = {}
for i in range(n):
  a = input()
  try:
    d[a] += 1
  except KeyError:
    d[a] = 1

cnt = 0
for k in d:
  if d[k] % 2 == 1:
    cnt += 1

print cnt

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=input()
b=[]
for i in range(a):
    b.append(input())
b.sort()
c=[]
pre=0
time=0
for i in b:
    if pre==i:
        time+=1
    else:
        if time%2==1:
            c.append(pre)
        pre=i
        time=1
if time%2!=0 and pre!=0:
    c.append(pre)
print len(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

x.sort()
i=0
while i < N-1:
    if x[i]==x[i+1]:
        del x[i+1]
        del x[i]
        N-=2
        continue
    i+=1
print(len(x))

Submission status: Accepted

Solution code:
import sys
from collections import Counter

# sys.stdin = open('c1.in')


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


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


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    n = read_int()
    c = Counter()
    for i in range(n):
        a = read_int()
        c[a] += 1

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


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

dic = {}

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

keys = dic.keys()
ct = 0
for i in keys:
    if dic[i] > 0:
        ct += 1

print ct

Submission status: Accepted

Solution code:
n = int(input())
d = dict()
for i in range(n):
    a = int(input())
    if a in d:
        if d[a] == 0:
            d[a] = 1
        else:
            d[a] = 0
    else:
        d[a] = 1

print(sum(d.values()))

Submission status: Accepted

Solution code:
time = int(input())
ans = []
n = 0
for i in range(time):
    ans.append(input())
ans.sort(key=int)
while n+1 < len(ans):
    if ans[n] == ans[int(n + 1)]:
        ans.pop(n)
        ans.pop(n)
    else:
        n += 1
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

b = set()
lenB = 0
for a in A:
    b.add(a)
    lenB += 1
    if len(b) != lenB:
        b.remove(a)
        lenB -= 2
print(len(b))

Submission status: Accepted

Solution code:
n = int(input())

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

array.sort()
last = -1
count = 0
ans = 0

for i in range(len(array)):
	if last != array[i]:
		if count % 2 == 1:
			ans += 1
		
		count = 1
	else:
		count += 1
		
	last = array[i]

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline())
di = {}
for i in xrange(n):
 m = int(stdin.readline())
 di[m] = di.get(m,0)^1
ans = 0
for i in di:
 ans += di[i]
print ans

Submission status: Accepted

Solution code:
N = int(raw_input())
A = map(int, [raw_input() for _ in xrange(N)])

s = set()
for x in A:
    if x in s:
        s.remove(x)
    else:
        s.add(x)
print len(s)

Submission status: Accepted

Solution code:
A={-1:False}
n=int(input())
count=0
for i in range(n):
    num=int(input())
    try:
        
        if(A[num]==True):
            count-=1
            A[num]=False
        else:
            count+=1
            A[num]=True
    except:
        #print("exception",A,num)
        A[num]=True
        count+=1
print(count)

Submission status: Accepted

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

res = []
tmp = A[0]
count = 1
for i in range(1,N):
    if A[i] == tmp:
        count += 1
    else:
        res.append(count%2 != 0)
        count = 1
    tmp = A[i]
res.append(count%2 != 0)

print(sum(res))

Submission status: Accepted

Solution code:
# coding;utf-8

n=int(input())
ans_dict={}
for i in range(0, n):
    a=input()
    if not a in ans_dict:
        ans_dict[a]=1
    else:
        ans_dict[a]+=1
sum=0
for thing in ans_dict:
    if ans_dict[thing]%2:
        sum+=1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = []

s = set()

for _ in range(N):
    inp = input()
    if inp in s:
        s.remove(inp)
    else:
        s.add(inp)

print(len(s))

Submission status: Accepted

Solution code:
import collections
N = int(input())
answer = 0
flag = collections.defaultdict(int)

for i in range(N):
  a = int(input())
  flag[a] = (flag[a]+1)%2

list = list(flag.values())

for i in range(len(list)):
  if list[i] == 1:
    answer+=1

print(answer)

Submission status: Accepted

Solution code:
import numpy as np
hoge = input()
N = int(hoge)
paper ={}
for i in range(N):
    hoge = input()
    hoge = hoge.strip()
    if hoge in paper:
        paper.pop(hoge)
    else:
        paper[hoge] = 1
    
print(len(paper))

Submission status: Accepted

Solution code:

def solve():  # 073C - Write and Erase
    N = int(input())
    joisino_list = {}
    cnt = 0

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

        if a in joisino_list:
            joisino_list[a] += 1
        else:
            joisino_list[a] = 1

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

    print(cnt)
    
  
solve()

Submission status: Accepted

Solution code:
l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)

Submission status: Accepted

Solution code:
num = int(input())
ary = []
ans = 0
for a in range(num):
    ary.append(int(input()))
ary.sort()
ikkomae = ary[0]
count = 1
for a in range(num):
    ind = a + 1
    if ind == num:
        break
    imano = ary[ind]
    if ikkomae == imano:
        count+=1
    else:
        if(count%2==1):
            ans+=1
        count = 1
    ikkomae = imano
if(count%2==1):
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
N=input()
d={}
r=0
for i in range(N):
    a=input()
    d[a]=d.get(a,0)+1
    r+=1
    if d[a]%2==0:
        r-=2
print r

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
def main():
    N=int(input())
    l=[]
    for i in range(N):
        l.append(int(input()))
    c=Counter(l)
    ans=0
    for i in c:
        if c[i]%2==1:
            ans+=1
    print(ans)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
n = int(input())
pool = {}
for i in range(n):
    a = int(input())
    if a not in pool:
        pool[a] = True
    else:
       del pool[a]
print(len(pool))

Submission status: Accepted

Solution code:
import functools
import collections
n = int(input())
print(sum(
    map(
        lambda x: x % 2,
        functools.reduce(
            lambda d, v: d.update({v: d[v]+1}) or d,
            [int(input()) for i in range(n)],
            collections.defaultdict(lambda: 0),
        ).values(),
    )
))

Submission status: Accepted

Solution code:
import collections

N = int(input())

def mod2(n):
    a = n % 2
    return a

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

count = collections.Counter(lis)

print(sum(map(mod2, count.values())))

Submission status: Accepted

Solution code:
from collections import Counter
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, = read_line(int)

counter = Counter()
for _ in range(n):
    a, = read_line(int)
    counter[a] += 1

count = 0
for n in counter.values():
    if n % 2 != 0:
        count += 1

print(count)

Submission status: Accepted

Solution code:
import numpy as np
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())

A=[int(input()) for i in range(N)]
A.sort()
ans=N

flag=False

for i in range(N-1):
	if flag==True:
		flag=False
		continue
	elif A[i]==A[i+1]:
		ans-=2
		flag=True
#print(A)
print(ans)

Submission status: Accepted

Solution code:
def C_WriteandErase(N, A):
    import collections
    count_dict = collections.Counter(A)  # 言った数字の出現回数
    ans = 0
    for k, v in count_dict.items():  # 数字kはv回出たことを意味する
        if v % 2 == 0:  # kが偶数回出たなら、kは紙に残らない
            pass
        else:
            ans += 1  # kが奇数回出たなら、その数字は残っている
    return ans

N = int(input())
A = [int(input()) for i in range(N)]
print(C_WriteandErase(N, A))

Submission status: Accepted

Solution code:
N=int(raw_input())

num={}
for i in range(N):
    a=int(raw_input())
    if a in num:
        num[a]^=1
    else:
        num[a]=1

c=0
for k in num:
    if num[k]==1:
        c+=1
print c

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
numbers = [input() for i in range(n)]
counter = Counter(numbers)
how = []
for w, c in counter.most_common():
    if int(c) % 2 == 1:
        how.append(w)
print(len(how))

Submission status: Accepted

Solution code:
from collections import Counter

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

counter = Counter(a)

ans = 0
for num in counter:
	if counter[num] % 2 == 1:
		ans += 1

        
print(ans)

Submission status: Accepted

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

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 sys

written = set()

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

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

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())
A = [int(input()) for _ in range(N)]
A.sort()


def customCount(idx):
    target = A[idx]
    cnt = 1
    idx += 1
    while True:
        if idx == N or A[idx] != target:
            return cnt
        else:
            idx += 1
            cnt += 1


index = 0
result = 0
while True:
    num = customCount(index)
    index += num
    if (num % 2) == 1:
        result += 1
    if N <= index:
        break
print(result)

Submission status: Accepted

Solution code:
from collections import defaultdict

def main():
    d = defaultdict(lambda: 0)
    n = int(input())
    for _ in range(n):
        x = int(input())
        d[x] += 1

    cnt = 0
    for key, value in sorted(d.items(), key=lambda x: x[1], reverse=True):
        if value%2 == 1:
            cnt += 1
    print(cnt)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
num=int(raw_input())
tmp={}
for i in range(num):
    a=int(raw_input())
    if a in tmp:
        tmp[a]+=1
    else:
        tmp[a]=1

output=0
for i in tmp:
    if tmp[i]%2 ==1:
        output+=1
print output

Submission status: Accepted

Solution code:
a = int(input())
s = set()
t = 0
for i in range(a):
   nb = int(input())
   if nb in s:
      s.remove(nb)
      t -= 1
   else:
      s.add(nb)
      t += 1
print(t)

Submission status: Accepted

Solution code:
from collections import Counter

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

    counter_a = Counter(A)

    ans = 0
    for count in counter_a.values():
        if count % 2 != 0:
            ans += 1
    # print(counter_a.values())
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [0] * n
d = {}
for i in range(n):
    a[i] = int(input())
    d[a[i]] = 0

for i in a:
    d[i] += 1

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

print(ans)

Submission status: Accepted

Solution code:
#Write and Erase

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

cnt = 0
for i in c.values():
    cnt += i%2
print(cnt)

Submission status: Accepted

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

a.sort()

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

print(len(a)-a.count(0))

Submission status: Accepted

Solution code:
N = input()
num = {}
for _ in xrange(N):
    a = raw_input().strip()
    if a in num: 
        num[a] += 1
    else:
        num[a] = 1
c = 0
for key in num:
    if(num[key]%2 == 1): c += 1
print c

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=int(input())

left=set()
for _ in range(n):
    i=input()
    if i in left:
        left.remove(i)
    else:
        left.add(i)
print(len(left))

Submission status: Accepted

Solution code:
import collections

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

Submission status: Accepted

Solution code:
N = int(input())

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

a = sorted(a)

t = 0
b = False
ans = 0
for i in range(N):
    if not a[i] == t:
        if b:
            ans += 1
        t = a[i]
        b = True
    else:
        if b:
            b = False
        else:
            b = True
if b:
    ans += 1


print(ans)

Submission status: Accepted

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

for i in range(N):
    new_num = input()
    if new_num in number_set:
        number_set.remove(new_num)
    else:
        number_set.add(new_num)

print(len(number_set))

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
l = defaultdict(int)
for _ in range(n):
    a = input()
    l[a] += 1
ans = 0
for i in l.values():
    if i % 2 == 1:
        ans += 1
    else:
        pass
print(ans)

Submission status: Accepted

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

import os
import sys
import math
import numpy as np


N = int(input())
A = np.array([int(input()) for i in range(N)])

counter = {}

for a in A:
    if a in counter.keys():
        counter[a] = abs(counter[a] - 1)
    else:
        counter[a] = 1

print(sum(counter.values()))

Submission status: Accepted

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections as col


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

ary = col.Counter(ary)

print(len([v for v in ary.values() if v%2 != 0]))

Submission status: Accepted

Solution code:
#!/usr/bin/python

import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        N = int(line)
        sheet = set()
        for i in xrange(N):
            a = sys.stdin.readline()
            if a in sheet:
                sheet.remove(a)
            else:
                sheet.add(a)
        print(len(sheet))
        line = sys.stdin.readline()
        

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
from collections import Counter


def main():
    N = int(input())
    counter = Counter(
        int(input())
        for _ in range(N)
    )
    answer = sum(
        1
        for v in counter.values()
        if v % 2 != 0
    )
    print(answer)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

a = {}

for _ in range(n):
    b = int(input())
    if b in a:
        del a[b]
    else:
        a[b] = True

print(len(a.keys()))

Submission status: Accepted

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


Memo = []
def solve(data):
    global Memo
    for d in data:
        if d in Memo:
            Memo.remove(d)
        else:
            Memo.append(d)
    return len(Memo)


def solve2(data):
    from collections import Counter
    c = Counter(data).most_common()
    remaining = [x for x in c if x[1]%2==1]
    return len(remaining)


def main():
    N = int(input())
    data = [int(input()) for _ in range(N)]
    result = solve2(data)
    print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = input()
a = [input() for i in range(N)]
#print a

dict={}


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

#print dict

cnt=0
for key,value in dict.items():			
	cnt+=value%2

print cnt

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())

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

count = Counter(ans)

anser = 0
for _ in count.values():
    if _ % 2 == 1:
        anser += 1

print(anser)

Submission status: Accepted

Solution code:
#!usr/bim/python
#! -*- coding: utf-8 -*-

n = raw_input()
n = int(n)

al = []

for i in range(n):
    a = raw_input()
    a = int(a)
    al.append(a)

al.sort()

num = 0

i = 0
while i < n:
    if i == n-1:
        num += 1
        break
    if al[i] == al[i+1]:
        i += 2
    else:
        num += 1
        i += 1

print num

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

d = collections.Counter(A)
print(sum([1 for k, v in d.items() if v % 2] ))

Submission status: Accepted

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

	l.sort()

	i = 0
	ans = 0
	while i<(n-1):
		if l[i]==l[i+1]:
			i+=2
		else:
			i+=1
			ans+=1
	if i==n-1:
		ans+=1
			

	print(ans)

solution()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = tuple(int(input()) for _ in range(N))

    num = dict()
    for n in A:
        num[n] = num.get(n, 0) + 1

    ans = 0
    for v in num.values():
        ans += v % 2

    print(ans)

main()

Submission status: Accepted

Solution code:
N = int(input())

a = {}
for i in range(N):
    a_i = int(input())
    if a_i in a:
        del a[a_i]
    else:
        a[a_i] = 1

print(len(a))

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())

a = defaultdict(lambda: 0)

for _ in range(N):
    x = int(input())
    if a[x]:
        a[x] -= 1
    else:
        a[x] += 1

print(sum(a.values()))

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
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:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input()) #1行目のNを取得
l = [int(input()) for i in range(N)] #N回繰り返し s に値を取得

l.sort()


a=0
ans=0
for i in l:
	if i==a:
		ans -= 1
		a=0
	else:
		ans += 1
		a=i

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

import sys


def main():
    _ = sys.stdin.readline()
    arr = set()
    for line in sys.stdin:
        num = line.rstrip()
        if num in arr:
            arr.remove(num)
        else:
            arr.add(num)
    print(len(arr))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(raw_input())
s = {1,5}
s.remove(1)
s.remove(5)
for _ in xrange(n):
	a = int(raw_input())
	if a in s:
		s.remove(a)
	else:
		s.add(a)
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding=utf-8
N = int(raw_input().rstrip())
A = {}
for i in range(N):
    a = int(raw_input())
    if a in A:
        if A[a] == 1:
            A[a] = 0
        else:
            A[a] = 1
    else:
        A[a] = 1
print sum(A.values())

Submission status: Accepted

Solution code:
from collections import defaultdict
lst= defaultdict(bool)
for i in range(int(input())):
    t = input()
    lst[t] = not lst[t]

print(len([x for x in lst if lst[x]]))

Submission status: Accepted

Solution code:
n = int(input())
m = set()
while n:
    x = int(input())
    if x in m:
        m.remove(x)
    else:
        m.add(x)
    n -= 1
print(len(m))

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for i in range(N):
    a = int(input())
    if a in d:
        d[a] = 1 - d[a]
    else:
        d[a] = 1
print(sum(d.values()))

Submission status: Accepted

Solution code:
def c():
    from collections import Counter
    n = int(input())
    a = [int(input()) for _ in range(n)]
    c = dict(Counter(a))
    total = 0
    for v in c.values():
        total += v % 2
    print(total)

c()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

N = int(input())
nums = set()

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

    if A in nums:
        nums.remove(A)
    else:
        nums.add(A)
print(len(nums))

Submission status: Accepted

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

num_cnt = Counter(numbers)

ans_box = list(filter(lambda x:x%2==1 , num_cnt.values()))
print(len(ans_box))

Submission status: Accepted

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

c=Counter(c)
print(sum([1 for k, v in c.items() if v % 2 != 0]))

Submission status: Accepted

Solution code:


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

chk={}

for sa in a:
    if sa in chk:
        if chk[sa]==1:
            chk[sa]=0
        else:
            chk[sa]=1
    else:
        chk[sa]=1


print(sum(chk.values()))

Submission status: Accepted

Solution code:
N = int(input())
A = {}
for i in range(N):
    a = int(input())
    if a not in A:
        A[a] = 0
    A[a] = A[a] + 1
num = 0
for k, v in A.items():
    if v % 2 == 1:
        num = num + 1
print(num)

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-



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

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

    print(len(nums))

if __name__ == "__main__": main()