#include <bits/stdc++.h>
using namespace std;
const int LIMIT = 2000000000;
int main() {
  int n, maxv = 0, a;
  cin >> n;
  while (n--) cin >> a, maxv = max(maxv, a);
  cout << (a ^ maxv) << endl;
  return 0;
}
