#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, last;
  cin >> n;
  int* arr = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    last = i == n - 1 ? arr[i] : 0;
  }
  sort(arr, arr + n);
  cout << (arr[n - 1] ^ last);
  return 0;
}
