#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmp;
  int maxn = -1;
  cin >> n;
  while (n--) {
    cin >> tmp;
    maxn = max(maxn, tmp);
  }
  int ans = maxn ^ tmp;
  cout << ans << endl;
}
