#include <bits/stdc++.h>
using namespace std;
int n, m, k, x, y, sum, cnt, ans, a[1000];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    x = max(x, a[i]);
  }
  cout << (x ^ a[n - 1]) << endl;
  return 0;
}
