#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n, x, mx = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    mx = max(mx, x);
  }
  cout << (mx ^ x) << endl;
}
