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