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