#include <bits/stdc++.h>
using namespace std;
const int nn = (int)2000000;
const long double eps = 3 * 10e-8;
const long double eps1 = 5 * 10e-8;
const unsigned long long INF = (unsigned long long)(1e19 * 1.7);
const long long mod = 10;
int main() {
  int n, a = -1e9, b, k;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k;
    if (k > a) a = k;
    b = k;
  }
  cout << (a ^ b);
}
