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