#include <bits/stdc++.h>
using namespace std;
int n, x, maxi;
string s = "ABRACADABRA";
int main() {
  cin >> n;
  maxi = 0;
  while (n--) {
    cin >> x;
    maxi = max(maxi, x);
  }
  cout << (maxi ^ x) << endl;
  return 0;
}
