#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50 + 10;
const int MAXM = 1000 + 10;
const int INF = 1000000001;
const int MOD = 1000000007;
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  int n, x, m = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    m = max(x, m);
  }
  cout << (x ^ m) << endl;
  return 0;
}
