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