#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, m = 0x80000000;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    cin >> x;
    m = max(m, x);
  }
  cin >> x;
  cout << (max(m, x) ^ x);
  return 0;
}
