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