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