#include <bits/stdc++.h>
using namespace std;
int N, a[110], mx;
int main() {
  cin >> N;
  for (int i = (0); i < (N); i++) cin >> a[i], mx = max(mx, a[i]);
  cout << (a[N - 1] ^ mx) << endl;
  return 0;
}
