#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n, a, Max = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a;
    Max = max(Max, a);
  }
  cout << (Max ^ a) << endl;
  return 0;
}
