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