#include <bits/stdc++.h>
using namespace std;
int n, k, m;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) scanf("%d", &k), m = max(m, k);
  scanf("%d", &k), m = max(m, k);
  printf("%d\n", k ^ m);
  return 0;
}
