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