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