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