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 in C (GCC 5.4.1) (judge verdict: Time Limit Exceeded)

#include <stdio.h>
#include <math.h>

void quickSort(int *data, int left, int right);
int partition(int *data, int left, int right);
void swap(int *data, int i, int j);

int main(void)
{
  //与えられる配列の長さの入力
  int N;
  scanf("%d",&N);

  //配列の入力と同時にかぶっている数字の削除
  int A[N];
  int i,odd,Re=0;
  for(i=0; i<N; i++){
    scanf("%d",&A[i]);
  }

  //クイックソート
  quickSort(A,0,N-1);
  
  i=0;
  while(i<N){
    odd=1;
    while(A[i] == A[++i]){
      odd++;
    }
    Re+=odd%2;
  }
  
  printf("%d\n",Re);
  
  return 0;
}

//クイックソート
void quickSort(int *data, int left, int right){
  int k;

  if (left < right) {
    k = partition(data, left, right); // data を分割する枢軸の位置を求める
    quickSort(data,left,k-1);    // 値が枢軸より小さい要素への再帰
    quickSort(data,k+1,right);    // 値が枢軸より大きい要素への再帰
  }
}
int partition(int *data, int left, int right){
  int piv, i, j;
  
  piv = data[left];  // 指定範囲の左端を枢軸とする
  i = left;
  j = right + 1;
  while (1) {
    while (i < right &&data[++i] < piv);    // 枢軸より大きい要素の番号 i を取得
    while (data[--j] > piv); // 枢軸より小さい要素の番号 j を取得
    if (i >= j) { break; } // i が j 以上になったら終了
    swap(data, i, j); // data[i] と data[j] の入れ替え
  }
  swap(data, left, j); // 枢軸を正しい位置に移動
  return j;  // 枢軸の場所を返す
}
//data[i]とdata[j]の内容を交換する
void swap(int *data, int i, int j){
  int tmp;

  tmp = data[i];
  data[i] = data[j];
  data[j] = tmp;
}