stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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());

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}




// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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());

}


// Optimized solution to the same problem (faster):
#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;

}

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

#include<map>

#include<string>

#include<algorithm>

using namespace std;



int main() {

	int nums;

	map<string,bool> a;

	scanf("%d", &nums);

	map<string, bool> ::iterator it;

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

		string temp;

		cin >> temp;

		it = a.find(temp);

		if (it != a.end()) a.erase(it);

		else a[temp] = 1;

	}

	cout << a.size();

	return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

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

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    set<int> a;

    int x;

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

    {

        cin >> x;

        if(a.count(x) == 1)

            a.erase(x);

        else

            a.insert(x);



    }

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

    return 0;



}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

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

#include <cstdio>

#include <map>

using namespace std;



int main()

{

    int n,temp,con = 0;

    scanf("%d",&n);

    map<int,int> spare;

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

    {

        scanf("%d",&temp);

        if(spare[temp] == 0){

            spare[temp] = 1;

            con++;

        }

        else{

            spare[temp] = 0;

            con--;

        }

    }

    printf("%d",con);

    return 0;

}


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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

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

using namespace std;

#include <algorithm>



int main(){

    std::ios::sync_with_stdio(false);

    int n,i,j,number,total=0,count;

    cin>>n;

    long long a[n],b[n][2]={};

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

        cin>>a[i];

    }

    sort(a,a+n);

    i=0;

    while(i<n){

        number=a[i];

        count=0;

        while(i<n && a[i]==number){

            count++;

            i++;

        }

        total+=count%2;

    }



    cout<<total;





    return 0;

}


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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

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

#include<string.h>

#include<stdlib.h>

#include<iostream>

#include<algorithm>

#include<string>

#include<map>

#define maxn 1005

using namespace std;

typedef long long  LL;

map<string,int>mp;

int main()

{

    int n;

    scanf("%d",&n);

    while(n--)

    {

        string s;

        cin>>s;

        mp[s]++;

    }

        map<string,int>::iterator it;

        int sum=0;

        for(it=mp.begin();it!=mp.end();++it)

        {

            int t=it->second;

            if(t%2==1)

                sum++;

        }

        cout<<sum<<endl;



}


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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

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

using namespace std;



int a[100001];



int main()

{

	int i,j,k,m,n;

	cin>>n;



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

		cin>>a[i];



	sort(a,a+n);

	int ans=0;

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

	{

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

		{

			i++;

			continue;

		}

		else

			ans++;

	}

	cout<<ans;

	return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

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

using namespace std;



int main(){

	int n,cnt=0,x;

	set<int> s;

	cin>>n;

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

		cin>>x;

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

			s.erase(x);

//			cout<<"00"<<endl;

			cnt++;

		}else{

			s.insert(x);

		}

	}

	cout<<n-2*cnt<<endl;

	return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

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

#include <string.h>

#include <cstdio>

#include <algorithm>

#include <string>

#include <math.h>

#include <map>

using namespace std;

#define ll long long

int n,m;

map<int,int> mp;

int main()

{

    scanf("%d",&n);

    int cnt = 0 ,x;

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

    {

        scanf("%d",&x);

        if(mp[x] == 0)

        {

            mp[x] = 1;

            cnt++;

        }

        else{

            if(mp[x] == 1)

            {

                mp[x] = 0;

                cnt--;

            }

        }

    }

    cout<<cnt<<endl;

    return 0;

}


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

#include<string.h>

#include<algorithm>

using namespace std;

int a[120000];

int b[100000];

int main()

{

    int n;

    scanf("%d",&n);

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

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

    sort(a,a+n);

    memset(b,0,sizeof(b));

    int s=0,j=0;

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

    {

        b[j]++;

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

        {

            b[j]++;

            i++;

        }

        if(b[j]&1)

            s++;

        j++;

    }

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

    return 0;

}

// Fastest known solution for this problem: