stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 4.809607746048671x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.858213819832499x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.802616284563756x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.846081327438306x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.900864203240425x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.857055905045658x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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.4883304629504055x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.853066900758268x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.89572659084634x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.836205549001452x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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.4861542595752155x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.849889228409405x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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.4861542595752155x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.869195026499732x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.8703482489520304x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    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: 4.8520258004050385x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    return 0;

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

#include <algorithm>

using namespace std;



const int M = 1e5+10;

int a[M];



int main()

{

	int m;

	cin>>m;

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

		cin>>a[i];

	sort(a,a+m);

	int cnt=0;

	a[m] = a[0]-1;

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

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

			cnt++;

		else

			i++;

	cout<<cnt<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.839227204476315x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    return 0;

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

#include<set>

using namespace std;

set<int> st;

set<int>::iterator it;

int main(){

	int n;

	cin>>n;

	while(n--){

		int a;

		cin>>a;

		it=st.find(a);

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

			st.erase(a);

		}else{

			st.insert(a);

		} 

	}

	int ans=0;

	for(int i=0;i<st.size();i++){

		ans++;

	} 

	cout<<ans<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 4.854268567340317x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    return 0;

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

#include<iostream>

#include<queue>

#include<map>

#include<set>

#include<vector>

#include<utility>

#include<stack>

#include<algorithm>

#include<string>

#include<string.h>

#define fi first

#define se second

#define pb push_back

using namespace std;

typedef long long ll;

typedef pair<ll,ll> ii;



const int N = 1e6;



set<int> ls;



int main(){

    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int n; cin >> n;

    while(n--){

        int x; cin >> x;

        if(ls.count(x))ls.erase(x);

        else ls.insert(x);

    }



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



}

// Faster C++ solution for the same problem (measured speedup: 4.909153114723576x):
#include<algorithm>

#include<stdio.h>

#include<string.h>

#include<math.h>

using namespace std;

int main()

{

    int n,a[100001];

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

    int f=0;

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

    {

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

       {

           a[i]=a[i+1]=0;

           f+=2;

           i=i+1;

       }

    }

    printf("%d\n",n-f);

    return 0;

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

#include <iomanip>

#include <algorithm>

#include <vector>





#define MOD 1000000007

#define INTMAX 0x7fffffff

#define INTMIN 0x80000000

#define LLMAX 0x7fffffffffffffffLL

#define LLMIN 0x8000000000000000LL



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

#define rep(i,n) REP(i,0,n)



using namespace std;

using ll = long long;



int main(){

    vector<int> v;



    int N;

    cin >> N;



    int A;

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

        cin >> A;

        auto it = lower_bound(v.begin(), v.end(), A);

        if (it != v.end() && *it == A) {

            //cout << "erase " << A << endl;

            v.erase(it);

        } else {

            //cout << "insert " << A << endl;

            v.insert(it, A);

        }

        //for (int vi : v) {

        //    cout << vi << ", ";

        //}

        //cout << endl;

    }



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

}

// Faster C++ solution for the same problem (measured speedup: 5.279763190164473x):
#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

map<int,bool> mp;

int num,n,x;

int main(){

	scanf("%d",&n);

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

		scanf("%d",&x);

		if(mp[x]){

			num--;

			mp[x] = false;

		}

		else{

			num++;

			mp[x] = true;

		}		

	}

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

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.181647630991564x):
#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;

}