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