#include <iostream>                                                                                                                                                                                         
#include <algorithm>                                                                                                                                                                                        
#include <cstring>                                                                                                                                                                                          
#include <vector>                                                                                                                                                                                           
#include <numeric>                                                                                                                                                                                          
using namespace std;                                                                                                                                                                                        
                                                                                                                                                                                                            
typedef long long ll;                                                                                                                                                                                       
                                                                                                                                                                                                            
int main()                                                                                                                                                                                                  
{                                                                                                                                                                                                           
    ll N;                                                                                                                                                                                                   
    cin >> N;                                                                                                                                                                                               
    vector<ll> A(N);                                                                                                                                                                                        
                                                                                                                                                                                                            
    for (int i=0; i < N; ++i) {                                                                                                                                                                             
        ll a;                                                                                                                                                                                               
        cin >> a;                                                                                                                                                                                           
        A[i] = a;                                                                                                                                                                                           
    }                                                                                                                                                                                                       
    sort(A.begin(), A.end());                                                                                                                                                                               
                                                                                                                                                                                                            
    int i, j;                                                                                                                                                                                               
    ll sum = 0;                                                                                                                                                                                             
    for (i = 0; i < N; i=j) {                                                                                                                                                                               
        ll n = A[i];                                                                                                                                                                                        
        for (j = i+1; j < N; ++j) {                                                                                                                                                                         
            if (n != A[j]) break;                                                                                                                                                                           
        }                                                                                                                                                                                                   
        if ((j-i)%2 == 1) sum++;                                                                                                                                                                            
    }                                                                                                                                                                                                       
                                                                                                                                                                                                            
    cout << sum << endl;                                                                                                                                                                                    
}                                                                                                                                                                                                           
        

Measured memory_bytes: 1024