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