#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, a[400005], y[34000000], sum[34000000], ans;
long long sumnum;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= 25; i++) {
    int s = 1 << i;
    for (int j = 0; j <= s; j++) y[j] = 0;
    for (int j = 1; j <= n; j++) y[a[j] % s]++;
    sum[0] = y[0];
    for (int j = 1; j <= s; j++) sum[j] = sum[j - 1] + y[j];
    sumnum = 0;
    for (int j = 0; j < s; j++) {
      int l = max(0, s / 2 - j);
      int r = s - j - 1;
      long long t = sum[r];
      if (l != 0) t -= sum[l - 1];
      if (j > s / 2) {
        int l = s / 2 * 3 - j;
        t += sum[s - 1];
        t -= sum[l - 1];
      }
      sumnum += ((long long)y[j]) * t;
      if (j >= l && j <= r) sumnum -= y[j];
      if (j > s / 2 && j >= s / 2 * 3 - j) sumnum -= y[j];
    }
    sumnum /= 2;
    if (sumnum & 1) ans += s >> 1;
  }
  cout << ans << endl;
  return 0;
}
