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