stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define ll long long

inline ll read(){ll x=0,f=1;char ch=getchar();for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')f=-1;for(;ch>='0'&&ch<='9';ch=getchar())x=x*10+ch-48;return x*f;}

inline void write(ll x){if(x>9)write(x/10);putchar('0'+x%10);}

inline void writeln(ll x){write(x);puts("");}

map<int,int>a;

int n,x,ans;

int main()

{

	n=read();

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

		x=read();

		if(a[x]){

			ans--;

			a[x]=0;

		}

		else{

			ans++;

			a[x]=1;

		}

	}

	writeln(ans);

}

// Faster C++ solution for the same problem (measured speedup: 5.192120234405424x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<map>

#include<cstdio>

#include<cstring>

#include<algorithm>

#define ll long long

#define N 100005

#define inf (1ll<<60)

#define rep(i,j,k) for (ll i=j;i<=k;++i)

#define per(i,j,k) for (ll i=j;i>=k;--i)

using namespace std;

inline ll read(){

	char ch=getchar(); ll x=0,f=1;

	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }

	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }

	return x*f;

}

ll n,ans;

map<ll,bool> mp;

int main(){

	n=read();

	rep(i,1,n){

		ll x=read();

		if (mp[x]){

			--ans; mp[x]=0;

		}else{

			++ans; mp[x]=1;

		}

	}

	printf("%lld",ans);

}

// Faster C++ solution for the same problem (measured speedup: 4.792431139446217x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cctype>

#include <algorithm>

#include <iostream>

#include <vector>

#include <map>

using namespace std;



typedef long long ll;

typedef double db;

typedef pair<int, int> pii;

typedef vector<int> vi;



namespace IO {

  static const int SZ = 1 << 20;

  static FILE *fin = stdin, *fout = stdout;

  static char ibuf[SZ], *is = ibuf, *it = ibuf;

  static char obuf[SZ], *os = obuf, *ot = obuf + SZ;



  inline char nextChar() {

    if (is == it) {

      it = (is = ibuf) + fread(ibuf, sizeof(char), SZ, fin);

      if (is == it)

        return EOF;

    }

    return *is++;

  }

  template <typename T>

  inline void readInt(T &x) {

    x = 0;

    T flag(1);

    char ch;

    for (ch = nextChar(); isspace(ch); ch = nextChar())

      ;

    if (ch == '-')

      ch = nextChar(), flag = -flag;

    for (; isdigit(ch); ch = nextChar())

      x = x * 10 + ch - '0';

    x *= flag;

  }

  inline void readCh(char &now) {

    for (now = nextChar(); isspace(now); now = nextChar())

      ;

  }



  inline void flushBuffer() {

    fwrite(obuf, sizeof(char), os - obuf, fout);

    os = obuf;

  }

  inline void printChar(char ch) {

    if (os == ot)

      flushBuffer();

    *os++ = ch;

  }

  template <typename T>

  inline void printInt(T x) {

    static int dig[20], cnt;

    if (os + 20 > ot)

      flushBuffer();

    if (x < 0)

      *os++ = '-', x = -x;

    cnt = 0;

    do {

      dig[++cnt] = x % 10;

      x /= 10;

    } while (x);

    for (int i = cnt; i > 0; --i)

      *os++ = dig[i] + '0';

  }

}



using namespace IO;



const int N = 1e5 + 5;



int n, a[N];

map<int, bool> mp;



int main() {

#ifdef LOCAL_DEBUG

  freopen("test.in", "r", stdin);

  freopen("test.out", "w", stdout);

#endif

  readInt(n);

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

    int p;

    readInt(p);

    if (mp[p])

      mp[p] = false;

    else mp[p] = true;

  }

  int ans = 0;

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

    if (it->second)

      ++ans;

  }

  printInt(ans);

  printChar('\n');

  flushBuffer();

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.196763670260326x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<map>

using namespace std;

map<int,int>mp;

int n,ans;

int main(){

	cin>>n;

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

		int x;

		cin>>x;

		if(mp[x]==1){

			ans--;

			mp[x]=0;

		}else{

			ans++;

			mp[x]=1;

		}

	}

	cout<<ans<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.249282356134722x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <algorithm>

#include <cmath>

#include <cstring>

#include <iostream>

#include <ctime>

#include <map>

#include <queue>

#include <cstdlib>

#include <string>

#include <climits>

#include <set>

#include <vector>

using namespace std;

inline int read(){

	int k=0,f=1;char ch=getchar();

	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}

	while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}

	return k*f;

}

inline void write(int x){

	if(x<0)putchar('-'),x=-x;

	if(x>9)write(x/10);putchar(x%10+'0');

}

inline void writeln(int x){

	write(x);puts("");

}

set<int>s;

int main()

{

	int n=read();

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

		int x=read();

		if(!s.count(x))s.insert(x);

		else s.erase(s.find(x));

	}

	writeln(s.size());

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.189209421563708x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

set<int> s;

int n,x;

int main()

{

	cin>>n;

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

	{

		cin>>x;

		if(s.count(x))

			s.erase(x);

		else

			s.insert(x);

	}

	cout<<s.size();

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.236173242245829x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
    #include <bits/stdc++.h>

    using namespace std;

    #define LL long long

    #define Max(a,b) ((a)>(b)?(a):(b)) 

    #define Min(a,b) ((a)<(b)?(a):(b)) 

     

    //FILE *fp,*fp2;

    //fp=fopen("input.txt","r");

    //fp2=fopen("output.txt","w");

     

    int main()

    {

        int n;

        set<LL int> num;

        set<LL int>::iterator it;

        cin>>n;

        LL int x;

        while(n--)

        {

            cin>>x;

            it=num.find(x);

            if (it ==num.end())

            {

                num.insert(x);

            }

            else

            {

                num.erase(it);

            }

        }

        x=num.size();

        cout<<x<<endl;

        

        return 0;

    }

     

// Faster C++ solution for the same problem (measured speedup: 5.2953659402272235x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h> 

using namespace std;

const int maxn=100000+10; 

map<int,int>m;

int main()

{

	int n,a;

	cin>>n;

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

	{

		cin>>a;

		m[a]++;

	}

	int ans=0;

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

	{

		int temp=(*it).second;

		if(temp%2==1)

			ans++;

	}

	cout<<ans<<endl;

	return 0; 

}

// Faster C++ solution for the same problem (measured speedup: 5.248031233420514x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<algorithm>

#include<string.h>

#include<set>

using namespace std;

typedef long long ll;

set<ll> st;set<ll>::iterator it;

int main() {

	ll n;

	scanf("%lld", &n);

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

		ll t;scanf("%lld", &t);

		it = st.find(t);

		if ( it== st.end()) {

			st.insert(t);

		}

		else st.erase(it);

	}

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

	getchar();getchar();

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.849624734812489x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include <stack>

#include<cstdio>

#include<algorithm>

#include<string.h>

#include<set>

#include<map>

#include<cmath>

#define MAXN 100001

#include<utility>

#define DEBUG 0



using namespace std;

typedef long long ll;

int main()

{

    #if DEBUG

    freopen("in.txt","r",stdin);

    #endif // DEBUG

    map<int,int> v;

    int n;

    scanf("%d",&n); 

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

    {

        int d;

        scanf("%d",&d);

        if(v.count(d)) v.erase(d);

        else v[d];

    }



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

    cout<<endl;

    #if DEBUG

    fclose(stdin);

    #endif // DEBUG



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.2437211288016385x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include <stdio.h>

#include <string.h>

#include <string>

#include <algorithm>

#include <map>

using namespace std;

#include <map>

#include <iostream>

int main()

{

	map<string, int> mp;

	int n;

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

	{

		string str;

		int num = 0;

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

		{

			cin >> str;

			mp[str]++;

		}

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

		{

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

				num++;

		}

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

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.289814768728176x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

using namespace std;







int main()

{

//	freopen("D:\\patin.txt","r",stdin);

	int N;

	int* num = new int[1000000];

	int* data = new int[1000000];

	int sum = 0;



	scanf("%d",&N);

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

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



	}

	sort(num,num+N);

	int len = 0;

	int pre = num[0];

	while(len < N){

		int tmp = 0;

		while(num[len] == pre && len < N){

			++tmp;

			++len;

		}

		if(tmp%2)

			++sum;

		pre = num[len];	

	}

	cout << sum << endl;

	return 0;	

} 

// Faster C++ solution for the same problem (measured speedup: 5.225502499576981x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#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\n",st.size());

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.847273354983526x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<math.h>

#include<string>

#include<vector>

#include<algorithm>

#include<map>

using namespace std;

int main()

{

	long long temp;

	int n;

	scanf("%d", &n);

	map<long long, int>p;

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

	{

		scanf("%lld", &temp);

		p[temp] += 1;

	}

	int count = 0;

	for (auto it = p.begin(); it != p.end(); ++it)

	{

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

			count++;

	}

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

	system("pause");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.240287665390381x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#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\n",st.size());

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.847273354983526x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<string>

#include<map>



typedef long long ll;



using namespace std;

map<ll,bool> m;

int main()

{

	int n;

	cin >> n;

	int num = 0;

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

		ll k;

		cin >> k;

		if(m[k] == true){

			m[k] = false;

			num--;

		}else{

			m[k] = true;

			num++;

		}

	}

	cout << num <<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.261147509984488x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<map>



using namespace std;

typedef long long ll;



map< ll, int> num;



int main()

{

    int n;

    int a;

    int sum = 0;



    cin >> n;

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

    {

        scanf("%d", &a);

        if(num[a])

        {

            num[a]--;

            sum--;

        }

        else

        {

            num[a]++;

            sum++;

        }

    }

    cout << sum << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.262393562648295x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<set>

using namespace std;

set <int> s;

int main()

{

    int n;

    cin>>n;

    while(n--)

    {

        int x;

        cin>>x;

        if(s.find(x)!=s.end())

            s.erase(x);

        else

            s.insert(x);

    }

    cout<<s.size()<<endl;

    return 0;

 } 


// Faster C++ solution for the same problem (measured speedup: 5.242596223657928x):
#include<stdio.h>

#include<algorithm>

#include<string.h>

using namespace std;

int a[100005];

int main()

{

    int n,sum=0,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)

    {

        if(a[i]==a[n-1]&&(n-i)%2==1)

        {

            sum++;

            break;

        }

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

        {

            if(a[i]!=a[j]&&(j-i)%2==1)

            {

                sum++;

                break;

            }

            else if(a[i]!=a[j]&&(j-i)%2==0)

                break;

        }

    }

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

    return 0;

}