stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

int main()

{

    ll n,i,j,k,l,a,b,c;

     map<ll,ll>mp;

    cin>>n;

    c=0;

    for(i=0;i<n;i++)

    {

        cin>>k;

        if(mp[k]>0)

        {

            mp[k]--;

            c--;

        }

        else if(mp[k]==0)

        {

            mp[k]++;

            c++;

        }

    }

    cout<<c<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;



int main()

{

    int n;

    scanf("%d", &n);

    int a[n];

    for (int i = 0; i < n; i++)

    {

        scanf("%d", &a[i]);

    }

    sort(a, a + n);

    int c = 1, ans = 0;

    for (int i = 0; i < n; i++)

    {

        if (a[i] == a[i + 1])

        {

            c++;

        }

        if (a[i] != a[i + 1])

        {

            if (c % 2 == 0)

            {

                ans--;

                c = 1;

            }

            if (c % 2 == 1)

            {

                ans++;

                c = 1;

            }

        }

    }

    printf("%d\n", ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



#define ll long long int

using namespace std;

int main()

{

   ll n,l,r,count=0;

   map<int,int>m;

   cin>>n;

   for(int i=0;i<n;i++ )

   {

       cin>>l;

       m[l]++;

       if(m[l]==2)

       {

           count++;

           m[l]=0;

       }



   }

   cout<<n-(2*count)<<endl;

   m.clear();

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;



int main()

{

    int n;

    scanf("%d", &n);

    int a[n];

    for (int i = 0; i < n; i++)

    {

        scanf("%d", &a[i]);

    }

    sort(a, a + n);

    int c = 1, ans = 0;

    for (int i = 0; i < n; i++)

    {

        if (a[i] == a[i + 1])

        {

            c++;

        }

        if (a[i] != a[i + 1])

        {

            if (c % 2 == 0)

            {

                ans--;

                c = 1;

            }

            if (c % 2 == 1)

            {

                ans++;

                c = 1;

            }

        }

    }

    printf("%d\n", ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <string>

#include <algorithm>

#include <map>

using namespace std;



int main()

{

    int N;

    while(cin>>N){

        map<int,int> m;

        int num;

        int sum=0;

        for(int i=0;i<N;i++){

            cin>>num;

            if(m[num]==0){

                sum++;

                m[num]=1;

            }

            else if(m[num]==1){

                sum--;

                m[num]=0;

            }

        }

        cout<<sum<<endl;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;



int main()

{

    int n;

    scanf("%d", &n);

    int a[n];

    for (int i = 0; i < n; i++)

    {

        scanf("%d", &a[i]);

    }

    sort(a, a + n);

    int c = 1, ans = 0;

    for (int i = 0; i < n; i++)

    {

        if (a[i] == a[i + 1])

        {

            c++;

        }

        if (a[i] != a[i + 1])

        {

            if (c % 2 == 0)

            {

                ans--;

                c = 1;

            }

            if (c % 2 == 1)

            {

                ans++;

                c = 1;

            }

        }

    }

    printf("%d\n", ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <set>

using namespace std;

int n, a, s;

set<int> st;

int main() {

	scanf("%d", &n);

	while(n--) {

		scanf("%d", &a);

		if(st.count(a)) st.erase(a);

		else st.insert(a);

	}

	printf("%d", st.size());

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;

int n, s, a[100005];

int main() {

	int i, j;

	scanf("%d", &n);

	for(i=0; i<n; i++) scanf("%d", &a[i]);

	sort(a, a+n);

	for(i=0; i<n; i=j) {

		for(j=i; j<n && a[j]==a[i]; j++);

		s += (j-i)%2;

	}

	printf("%d", s);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <set>

using namespace std;



int n, a;

set<int> st;

int main() {

	scanf("%d", &n);

	while(n--) {

		scanf("%d", &a);

		if(st.count(a)) st.erase(a);

		else st.insert(a);

	}

	printf("%d", st.size());

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;

int n, s, a[100005];

int main() {

	int i, j;

	scanf("%d", &n);

	for(i=0; i<n; i++) scanf("%d", &a[i]);

	sort(a, a+n);

	for(i=0; i<n; i=j) {

		for(j=i; j<n && a[j]==a[i]; j++);

		s += (j-i)%2;

	}

	printf("%d", s);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <map>

using namespace std;

int n, a, s;

map<int,int> mp;

int main() {

	scanf("%d", &n);

	while(n--) {

		scanf("%d", &a);

		(mp[a]^=1) ? ++s : --s;

	}

	printf("%d", s);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;

int n, s, a[100005];

int main() {

	int i, j;

	scanf("%d", &n);

	for(i=0; i<n; i++) scanf("%d", &a[i]);

	sort(a, a+n);

	for(i=0; i<n; i=j) {

		for(j=i; j<n && a[j]==a[i]; j++);

		s += (j-i)%2;

	}

	printf("%d", s);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <set>

using namespace std;



int main() {

    int n;

    int res = 0;

    cin >> n;

    set< int > s;

    for (int i = 0; i < n; i++) {

        int a;

        cin >> a;

        decltype(s)::iterator it = s.find(a);

        if (it != s.end()) {

            s.erase(a);

        } else {

            s.insert(a);

        }

    }

    cout << s.size();

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// skyrim belongs to the nords

#include<bits/stdc++.h>

#define mp make_pair

#define pb push_back 

#define sz(a) ((int)(a).size())

#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)

#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)

#define clr(a,v) memset(a, v, sizeof(a))

#define all(a) (a).begin(),(a).end() 

#define LOGN 18

#define EPS 1e-8

#define fcin ios_base::sync_with_stdio(false)

using namespace std;

typedef long long ll;

typedef double ld;

typedef pair<int,int> pii;

typedef vector<int> vi;



bool loc[100005];

set<int> sit;

int main(){

	fcin;

	cin.tie(0);

	int N, val;

	cin >> N;

	for (int i = 0; i < N; i++) {

		cin >> val;

		if (!sit.count(val)) sit.insert(val);

		else sit.erase(val);

	}

	cout << sit.size();

	return 0;

}

 

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

map<int,int> mp;

int n,ans;

int a[100010];

 int main()

{

	scanf("%d",&n);

	for (int i=1;i<=n;++i) scanf("%d",&a[i]);

	for (int i=1;i<=n;++i)

		if (mp[a[i]]) mp[a[i]]=0;

		else mp[a[i]]=1;

	for (int i=1;i<=n;++i)

		if (mp[a[i]]) ++ans,mp[a[i]]=0;

	printf("%d",ans);

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <set>

using namespace std;



int main(void)

{

    int N,x;

    scanf("%d",&N);

    set<int> s;

    while(N--)

    {

        scanf("%d",&x);

        if(s.count(x)==0)

            s.insert(x);

        else

            s.erase(x);

    }

    printf("%d\n",s.size());

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <iostream>

#include <algorithm>

#include <vector>

#include <set>



using namespace std;



int main()

{

    int n;

    while(scanf("%d",&n)!=EOF)

    {

        set <int> st;

        for(int i=1;i<=n;i++)

        {

            int x;

            scanf("%d",&x);

            auto iter=st.find(x);

            if(iter==st.end())

                st.insert(x);

            else

                st.erase(iter);

        }

        printf("%d\n",st.size());

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



map<int,int> mm;



int main(){



    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++){

        int x;

        scanf("%d",&x);

        if(mm.find(x)!=mm.end()){

            mm.erase(x);

        }else{

            mm[x]=1;

        }

    }

    printf("%d\n",mm.size());

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int MAX = 10005;

typedef long long ll;

vector<int> vec;

int n, m;

int arr[MAX];

map<int, int>mp;

int main(){

//	freopen("aa.txt","r",stdin);

	cin >> n;

	int ans = 0;

//	memset(arr, 0, sizeof(arr));

	int a;

	for(int i = 0; i < n; i++){

		cin >> a;

		if(mp.find(a) != mp.end()){

			mp[a]++;

			if(mp[a] == 1) ans++;

			else {

				mp[a] = 0;

				ans--;

			}

		}else{

			mp[a] = 1;

			ans++;

		}

	}

	cout << ans << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <string>

#include <vector>

#include <map>

using namespace std;

int main() {

	int cnt = 0;

	int n, t;

	scanf("%d", &n);

	map<int, bool> m;

	for (int i = 0;i < n;i++) {

		scanf("%d", &t);

		if (m[t] == false) {

			m[t] = true;

			cnt++;

		} else {

			m[t] = false;

			cnt--;

		}

	}

	printf("%d", cnt);

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<map>

using namespace std;

#define MAXN 1005

map<int,int> A;

int main(){

	int n;

	cin>>n;

	while(n--){

		int tmp;

		cin>>tmp;

		A[tmp]++;

	}

	int num=0;

	for(map<int,int>::iterator it=A.begin();it!=A.end();it++){

		if(it->second % 2==1)

			num++;

	}

	cout<<num;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cmath>

#include <algorithm>

#include <cstring>

#include <iostream>

#include <cstdio>

#include <ctype.h>

#include <string>

#include <vector>

#include <map>

#include <set>

#include <unordered_map>

#define INF 0x3fffffff

#define DEBUG 1

#define MAXSIZE 100005

using namespace std;

typedef long long LL;



map<int, bool> mapp;

int main() {

	int n;

	scanf("%d", &n);

	int num = 0;

	for (int i = 0; i < n; i++) {

		int a;

		scanf("%d", &a);

		if (mapp.count(a) == 0 || mapp[a] == false) {

			num++;

			mapp[a] = true;

		}

		else {

			num--;

			mapp[a] = false;

		}

	}

	printf("%d", num);

	printf("\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<vector>

#include<set>

using namespace std; 

set<int> table;

int main(){

	int n;

	scanf("%d",&n);

	for(int i=0;i<n;i++){

		int temp;

		bool flag = true;

		scanf("%d",&temp);

		set<int>::iterator it;

		//find

		it = table.find(temp);

		if(it==table.end()) table.insert(temp);

		else table.erase(it); 

	} 

	printf("%d",table.size());

	return 0; 

} 

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <stdio.h>

#include <set>

#define MAXSIZE 100010

using namespace std;

long long a[MAXSIZE];

set<long long> st;



int main()

{

    int n;

    int num = 0;

    set<long long>::iterator it;

    cin>>n;

    for(int i = 0;i < n;i++)

    {

        cin>>a[i];

        it = st.find(a[i]);

        if(it == st.end())

        {

            st.insert(a[i]);

            num++;

        }

        else

        {

            st.erase(a[i]);

            num--;

        }

    }

    cout<<num<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <stdio.h>

#include <math.h>

#include <algorithm>

#include <string>

#include <map>

#include <queue>

#include <vector>

#include <string.h>

using namespace std;

map<string,int>mp;

int main()

{

    int n;

    scanf("%d",&n);

    int cnt = 0;

    for (int i = 0;i<n;i++) {

        string c;

        cin>>c;

        if (mp.find(c)==mp.end()){

            cnt++;

            mp[c] = 1;

        }

        else {

            cnt--;

            mp.erase(c);

        }

    }

    printf("%d",cnt);

	return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

using namespace std;

int cmp(const void* a,const void* b){

	return *(const int*)a-*(const int*)b;

}

int main(){

	int n=0;

	cin>>n;

	int *a=new int[n];

    int count=0;

    int i=0;

	while(i<n){

	cin>>a[i++];

	}

	qsort(a,n,sizeof(int),cmp); 

	for(int i=0;i<n;i++){

		int temp=1;

		while(i<(n-1)&&a[i]==a[i+1]){

		   temp++;

		   i++;

	    }

		if(temp&0x01)count+=1 ;

	}

	cout<<count;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <set>

using namespace std; 

int main(){

	set<int> st;

	int n,a,count=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++){

		scanf("%d",&a);

		if(st.count(a)==0){

			st.insert(a);

			count++;

		}else{

			st.erase(a);

			count--;

		}

			

	}

	printf("%d",count);

	return 0; 

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <algorithm>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int num[n];

	for(int i=0;i<n;i++)

	{

		scanf("%d",&num[i]);

	}

	sort(num,num+n);

	int ans=0;

	int k=0;

	while(k<n)

	{

		int count=0;

		int last=num[k];

		while(k<n&&num[k]==last)

		{

			count++;

			k++;

		}

		ans+=count%2;

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int main()

{

	int n;

	int a[100005];

	scanf("%d",&n);

	memset(a,0,sizeof(a));

	for(int i=0;i<n;i++)

	{

		scanf("%d",&a[i]);

	}

	sort(a,a+n);

	int x=0;

	for(int j=0;j<n;)

	{

		if(a[j]==a[j+1])

		{

		x+=0;

		j+=2;

	}

		else

		{

			j+=1;

			x++;

		}



	}

	printf("%d\n",x);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

long long a[1000010];

int main()

{

    int n,x=1,ans=0;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

        scanf("%lld",&a[i]);

    sort(a,a+n);

    for(int i=1;i<n;i++)

    {

        if(a[i]==a[i-1])

            x=(x+1)%2;

        else

        {

            ans+=x;

            x=1;

        }

    }

    if(x%2)

        ans++;

    printf("%d\n",ans);

    return 0;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<cstdio>

#include<cstdlib>

#include<hash_map>

#include<algorithm>

using namespace std;

using namespace __gnu_cxx;

int main()

{

    int n;

    cin>>n;

    hash_map<int,int>mp;

    int cnt=0;

    for(int i=0;i<n;++i)

    {

        int x;

        cin>>x;

        hash_map<int,int>::iterator it;

        it=mp.find(x);

        if(it!=mp.end())

        {

            mp[x]++;

        }

        else

        {

            mp[x]=1;

        }

    }

    /*map<int,int>::iterator iter;

    iter=mp.begin();

    int cnt=0;

    while(iter!=mp.end())

    {

        if((iter->second)==1)

            ++cnt;

        ++iter;

    }*/

    hash_map<int,int>::iterator it;

    it=mp.begin();

    while(it!=mp.end())

    {

        if((it->second)%2!=0)

            ++cnt;

        ++it;

    }

    cout<<cnt;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

long long a[1000010];

int main()

{

    int n,x=1,ans=0;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

        scanf("%lld",&a[i]);

    sort(a,a+n);

    for(int i=1;i<n;i++)

    {

        if(a[i]==a[i-1])

            x=(x+1)%2;

        else

        {

            ans+=x;

            x=1;

        }

    }

    if(x%2)

        ans++;

    printf("%d\n",ans);

    return 0;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<set>

using namespace std;



int main() {

	set<int> st;

	int n, x;

	scanf("%d", &n);

	while (n--) {

		scanf("%d", &x);

		if (st.count(x) == 0)

			st.insert(x);

		else

			st.erase(x);

	}

	printf("%d", st.size());

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

long long a[1000010];

int main()

{

    int n,x=1,ans=0;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

        scanf("%lld",&a[i]);

    sort(a,a+n);

    for(int i=1;i<n;i++)

    {

        if(a[i]==a[i-1])

            x=(x+1)%2;

        else

        {

            ans+=x;

            x=1;

        }

    }

    if(x%2)

        ans++;

    printf("%d\n",ans);

    return 0;

}




// Fastest known solution for this problem: