#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, less<int> > q;
int n, x;
int main() {
  scanf("%d", &n);
  for (register int i = 0; i < n; i++) {
    scanf("%d", &x);
    q.push(x);
  }
  printf("%d", (x ^ q.top()));
  return 0;
}
