stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <climits>

#include <iostream>

#include <vector>

#include <string>

#include <sstream>

#include <algorithm>

#include <utility>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <deque>

#include <functional>



using namespace std;



#define int long long



#define fst first

#define scd second

#define PB push_back

#define MP make_pair

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

#define rall(a) a.rbegin(),a.rend()

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define rep(i,x) for(int i=0;i<(int)(x);++i)

#define rep1(i,x) for(int i=1;i<=(int)(x);++i)



typedef long long ll;

typedef long double ld;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef pair<int, int> pii;

typedef vector<pii> vpii;



template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}

template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}

template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}

template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>T get(){T a;cin>>a;return a;}

template<typename T>T rev(T a){reverse(all(a));return a;}

template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}



const int inf = 3e18;

const ll linf = 3e18;

const double eps = 1e-9;



int N, M, K;

int A[20005];

int memo[20005];



int rec(int now)

{

    if (~memo[now]) return memo[now];



    int res = inf;

    int mi = inf, ma = -inf;

    

    for (int i = 0; i < min(N - now, M); ++i) {

        mi = min(mi, A[now + i]);

        ma = max(ma, A[now + i]);



        res = min(res, K + (ma - mi) * (i + 1) + rec(now + i + 1));

    }



    if (res == inf) res = 0;



    return memo[now] = res;

}



signed main()

{ // #define int long long ?????????????????§scanf???????????¨???????????????????????\?????????????????????

    cin >> N >> M >> K;



    rep(i, N) {

        cin >> A[i];

    }



    memset(memo, -1, sizeof (memo));



    cout << rec(0) << endl;

}

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



using namespace std;



#define int long long



int a[20005];

int dp[20005];



signed main()

{

    int N, M, K; cin >> N >> M >> K;



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

        cin >> a[i];

        dp[i + 1] = 3e18;

    }



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

        int mi = 1e9, ma = -1e9;



        for (int j = 0; j < M; ++j) {

            if (i + j >= N) continue;



            mi = min(mi, a[i + j]);

            ma = max(ma, a[i + j]);



            dp[i + j + 1] = min(dp[i + j + 1], dp[i] + (j + 1) * (ma - mi) + K);

        }

    }



    cout << dp[N] << endl;

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

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <climits>

#include <iostream>

#include <vector>

#include <string>

#include <sstream>

#include <algorithm>

#include <utility>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <deque>

#include <functional>



using namespace std;



#define int long long



#define fst first

#define scd second

#define PB push_back

#define MP make_pair

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

#define rall(a) a.rbegin(),a.rend()

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define rep(i,x) for(int i=0;i<(int)(x);++i)

#define rep1(i,x) for(int i=1;i<=(int)(x);++i)



typedef long long ll;

typedef long double ld;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef pair<int, int> pii;

typedef vector<pii> vpii;



template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}

template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}

template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}

template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>T get(){T a;cin>>a;return a;}

template<typename T>T rev(T a){reverse(all(a));return a;}

template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}



const int inf = 3e18;

const ll linf = 3e18;

const double eps = 1e-9;



int N, M, K;

int A[20005];

int memo[20005];



int rec(int now)

{

    if (~memo[now]) return memo[now];



    int res = inf;

    int mi = inf, ma = -inf;

    

    for (int i = 0; i < min(N - now, M); ++i) {

        mi = min(mi, A[now + i]);

        ma = max(ma, A[now + i]);



        res = min(res, K + (ma - mi) * (i + 1) + rec(now + i + 1));

    }



    if (res == inf) res = 0;



    return memo[now] = res;

}



signed main()

{ // #define int long long ?????????????????§scanf???????????¨???????????????????????\?????????????????????

    omajinai;

    cin >> N >> M >> K;



    rep(i, N) {

        cin >> A[i];

    }



    memset(memo, -1, sizeof (memo));



    cout << rec(0) << endl;

}

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



using namespace std;



#define int long long



int a[20005];

int dp[20005];



signed main()

{

    int N, M, K; cin >> N >> M >> K;



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

        cin >> a[i];

        dp[i + 1] = 3e18;

    }



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

        int mi = 1e9, ma = -1e9;



        for (int j = 0; j < M; ++j) {

            if (i + j >= N) continue;



            mi = min(mi, a[i + j]);

            ma = max(ma, a[i + j]);



            dp[i + j + 1] = min(dp[i + j + 1], dp[i] + (j + 1) * (ma - mi) + K);

        }

    }



    cout << dp[N] << endl;

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

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <climits>

#include <iostream>

#include <vector>

#include <string>

#include <sstream>

#include <algorithm>

#include <utility>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <deque>

#include <functional>



using namespace std;



#define int long long



#define fst first

#define scd second

#define PB push_back

#define MP make_pair

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

#define rall(a) a.rbegin(),a.rend()

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define rep(i,x) for(int i=0;i<(int)(x);++i)

#define rep1(i,x) for(int i=1;i<=(int)(x);++i)



typedef long long ll;

typedef long double ld;

typedef vector<int> vi;

typedef vector<vi> vvi;

typedef pair<int, int> pii;

typedef vector<pii> vpii;



template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}

template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}

template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}

template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>T get(){T a;cin>>a;return a;}

template<typename T>T rev(T a){reverse(all(a));return a;}

template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}



const int inf = 3e18;

const ll linf = 3e18;

const double eps = 1e-9;



int N, M, K;

int A[20005];

int memo[20005];



inline int rec(int now)

{

    if (~memo[now]) return memo[now];



    int res = inf;

    int mi = inf, ma = -inf;

    

    for (int i = 0, to = min(N - now, M); i < to; ++i) {

        mi = min(mi, A[now + i]);

        ma = max(ma, A[now + i]);



        res = min(res, K + (ma - mi) * (i + 1) + rec(now + i + 1));

    }



    if (res == inf) res = 0;



    return memo[now] = res;

}



signed main()

{ // #define int long long ?????????????????§scanf???????????¨???????????????????????\?????????????????????

    omajinai;

    cin >> N >> M >> K;



    rep(i, N) {

        cin >> A[i];

    }



    memset(memo, -1, sizeof (memo));



    cout << rec(0) << endl;

}

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



using namespace std;



#define int long long



int a[20005];

int dp[20005];



signed main()

{

    int N, M, K; cin >> N >> M >> K;



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

        cin >> a[i];

        dp[i + 1] = 3e18;

    }



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

        int mi = 1e9, ma = -1e9;



        for (int j = 0; j < M; ++j) {

            if (i + j >= N) continue;



            mi = min(mi, a[i + j]);

            ma = max(ma, a[i + j]);



            dp[i + j + 1] = min(dp[i + j + 1], dp[i] + (j + 1) * (ma - mi) + K);

        }

    }



    cout << dp[N] << endl;

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

using namespace std;

int n,x,ans;

map<int,int> mp;

int main(){

	scanf("%d",&n);

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

		scanf("%d",&x);

		if (mp[x]) ans--;

		else ans++;

		mp[x]^=1;

	}

	printf("%d",ans);

}

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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

#define N 100020

#define ll long long

using namespace std;

inline int read(){

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

	while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar());

	while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();

	return f?x:-x;

}

std::map<int, bool> mp;

int main(int argc, char const *argv[]) {

	int n = read(), ans = 0;

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

		int x = read();

		if (mp[x]) ans --, mp[x] = 0;

		else       ans ++, mp[x] = 1;

	}

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

	return 0;

}

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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

using namespace std;



using VS = vector<string>;    using LL = long long;

using VI = vector<int>;       using VVI = vector<VI>;

using PII = pair<int, int>;   using PLL = pair<LL, LL>;

using VL = vector<LL>;        using VVL = vector<VL>;



#define ALL(a)  begin((a)),end((a))

#define RALL(a) (a).rbegin(), (a).rend()

#define PB push_back

#define EB emplace_back

#define MP make_pair

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

#define SORT(c) sort(ALL((c)))

#define RSORT(c) sort(RALL((c)))

#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)

#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)

#define debug(x) cerr << #x << ": " << x << endl

const int INF = 1e9;                          const LL LINF = 1e16;

const LL MOD = 1000000007;                    const double PI = acos(-1.0);

int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };



/* -----  2018/02/14  Problem: 073_abc_c / Link: https://abc073.contest.atcoder.jp/tasks/abc073_c?lang=en  ----- */

/* ------問題------







-----問題ここまで----- */

/* -----解説等-----







----解説ここまで---- */



LL N;



LL ans = 0LL;



int main() {

	cin.tie(0);

	ios_base::sync_with_stdio(false);



	cin >> N;

	map<LL, LL>Map;

	FOR(i, 0, N) {

		LL a; cin >> a;

		Map[a]++;

	}



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

		if ((*it).second % 2 == 1)ans++;

	}

	cout << ans << "\n";



	return 0;

}


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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

using namespace std;



int a[10000000];



int main()

{

    int n,c=0,b=1,i,j;

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

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

    {

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

        {

            ++b;

        }

        else

        {

            if(b%2==1)

                ++c;

            b=1;

        }

    }

    b = b-1;

    if(a[n-1]!=a[n-2])

        ++c;

    else if(a[n-1]==a[n-2] && (b%2==0))

        ++c;



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

    return 0;

}


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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

using namespace std;

using ll = long long;

const int maxn = 1e5 + 10;



int vec[maxn];



string s[] = {"Adrian", "Bruno", "Goran"};

int ans[3];



int main() {

    int n, m;

    set<int> s;

    scanf("%d", &n);

    while(n--) {

        scanf("%d", &m);

        if(s.count(m)) s.erase(m);

        else s.insert(m);

    }

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

}

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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

#include<vector>

#include<algorithm>

#include<map>

#include<set>

#include<string>

#include<math.h>



using namespace std;



struct node{

 int x;

 int time;

 bool operator <(node &B)

 {

     if(time<B.time) return true;

     if(time==B.time) return x<B.x;

     return false;

 }

};

int main()

{

    int n;cin>>n;

    set<int>nums;

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

{

    int a;

    cin>>a;

    if(nums.count(a))

    {

        nums.erase(a);

    }else

    nums.insert(a);

}

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





return 0;

}




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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

#include<cstring>

#include<iostream>

#include<map>

#include<cmath>

//#include<windows.h>

#include<algorithm>

#include<set>

const double eps = 1e-1;

using namespace std;

typedef long long ll;

map<int,int>play;

int main(){



    int n;

    scanf("%d",&n);

    int num=0;

    while(n--){

        int t;

        scanf("%d",&t);

        if(play[t]==1)play[t]--,num--;

        else play[t]++,num++;

    }

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

    return 0;

}

//Hello World Here I Come

//          0                 10

//        0 1 1                8

//      0 1 1 2 3              6

//    0 1 1 2 3 5 8            4

//  0 1 1 2 3 5 8 13 21        2

//0 1 1 2 3 5 8 13 21 34 55    0


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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

#include <cstdio>

#include <set>

using namespace std;



int main()

{

    int n,i,t;

    scanf("%d",&n);

    set<int> a;

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

        scanf("%d",&t);

        if(a.end()==a.find(t))

            a.insert(t);

        else

            a.erase(t);

    }

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

}


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

#include <algorithm>

using namespace std;

int main(){

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



	unsigned int per[100005];

	int N;

	scanf("%d",&N);

	int  i,j,count = 0;

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

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

		/*for(j = 0;j<i;j++){

			if(per[i]==per[j]){

				count -=2;

				per[i]=0;

				per[j]=0;

				break;

			}

		}*/

	}

	sort(per,per+N);

	count = N;

	for(i = 1;i<N;i++){

		if(per[i]==per[i-1]){

			count-=2;

			i++;

		}

	}

	printf("%d",count);

	return 0;

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

using namespace std;

int n,x,ans;

map<int,int> mp;

int main(){

	scanf("%d",&n);

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

		scanf("%d",&x);

		if (mp[x]) ans--;

		else ans++;

		mp[x]^=1;

	}

	printf("%d",ans);

}

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

#include<stdlib.h>



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

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

}



int main(){

	int N,a[100005]={0};

	scanf("%d",&N);

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

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

	}

	qsort(a,N,sizeof(a[0]),cmp);

	int cnt=1,res=0;

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

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

			if(cnt%2!=0){

				res++;

			}

			cnt=1;

		}

		else{

			cnt++;

		}

	}

	if(cnt%2!=0){

		res++;

	}

	printf("%d",res);

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

#define N 100020

#define ll long long

using namespace std;

inline int read(){

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

	while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar());

	while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();

	return f?x:-x;

}

std::map<int, bool> mp;

int main(int argc, char const *argv[]) {

	int n = read(), ans = 0;

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

		int x = read();

		if (mp[x]) ans --, mp[x] = 0;

		else       ans ++, mp[x] = 1;

	}

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

	return 0;

}

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

#include<stdlib.h>



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

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

}



int main(){

	int N,a[100005]={0};

	scanf("%d",&N);

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

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

	}

	qsort(a,N,sizeof(a[0]),cmp);

	int cnt=1,res=0;

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

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

			if(cnt%2!=0){

				res++;

			}

			cnt=1;

		}

		else{

			cnt++;

		}

	}

	if(cnt%2!=0){

		res++;

	}

	printf("%d",res);

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

using namespace std;



using VS = vector<string>;    using LL = long long;

using VI = vector<int>;       using VVI = vector<VI>;

using PII = pair<int, int>;   using PLL = pair<LL, LL>;

using VL = vector<LL>;        using VVL = vector<VL>;



#define ALL(a)  begin((a)),end((a))

#define RALL(a) (a).rbegin(), (a).rend()

#define PB push_back

#define EB emplace_back

#define MP make_pair

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

#define SORT(c) sort(ALL((c)))

#define RSORT(c) sort(RALL((c)))

#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)

#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)

#define debug(x) cerr << #x << ": " << x << endl

const int INF = 1e9;                          const LL LINF = 1e16;

const LL MOD = 1000000007;                    const double PI = acos(-1.0);

int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };



/* -----  2018/02/14  Problem: 073_abc_c / Link: https://abc073.contest.atcoder.jp/tasks/abc073_c?lang=en  ----- */

/* ------問題------







-----問題ここまで----- */

/* -----解説等-----







----解説ここまで---- */



LL N;



LL ans = 0LL;



int main() {

	cin.tie(0);

	ios_base::sync_with_stdio(false);



	cin >> N;

	map<LL, LL>Map;

	FOR(i, 0, N) {

		LL a; cin >> a;

		Map[a]++;

	}



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

		if ((*it).second % 2 == 1)ans++;

	}

	cout << ans << "\n";



	return 0;

}


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

#include<stdlib.h>



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

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

}



int main(){

	int N,a[100005]={0};

	scanf("%d",&N);

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

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

	}

	qsort(a,N,sizeof(a[0]),cmp);

	int cnt=1,res=0;

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

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

			if(cnt%2!=0){

				res++;

			}

			cnt=1;

		}

		else{

			cnt++;

		}

	}

	if(cnt%2!=0){

		res++;

	}

	printf("%d",res);

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

using namespace std;



int a[10000000];



int main()

{

    int n,c=0,b=1,i,j;

    scanf("%d",&n);

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

    {

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

    }

    sort(a,a+n);

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

    {

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

        {

            ++b;

        }

        else

        {

            if(b%2==1)

                ++c;

            b=1;

        }

    }

    b = b-1;

    if(a[n-1]!=a[n-2])

        ++c;

    else if(a[n-1]==a[n-2] && (b%2==0))

        ++c;



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

    return 0;

}


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

#include<stdlib.h>



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

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

}



int main(){

	int N,a[100005]={0};

	scanf("%d",&N);

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

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

	}

	qsort(a,N,sizeof(a[0]),cmp);

	int cnt=1,res=0;

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

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

			if(cnt%2!=0){

				res++;

			}

			cnt=1;

		}

		else{

			cnt++;

		}

	}

	if(cnt%2!=0){

		res++;

	}

	printf("%d",res);

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

using namespace std;

using ll = long long;

const int maxn = 1e5 + 10;



int vec[maxn];



string s[] = {"Adrian", "Bruno", "Goran"};

int ans[3];



int main() {

    int n, m;

    set<int> s;

    scanf("%d", &n);

    while(n--) {

        scanf("%d", &m);

        if(s.count(m)) s.erase(m);

        else s.insert(m);

    }

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

}

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

#include<stdlib.h>



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

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

}



int main(){

	int N,a[100005]={0};

	scanf("%d",&N);

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

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

	}

	qsort(a,N,sizeof(a[0]),cmp);

	int cnt=1,res=0;

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

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

			if(cnt%2!=0){

				res++;

			}

			cnt=1;

		}

		else{

			cnt++;

		}

	}

	if(cnt%2!=0){

		res++;

	}

	printf("%d",res);

}