#include <bits/stdc++.h>
using namespace std;
const char* st = "*ABRACADABRA";
int n, x, mx = -1;
int a[100010];
int main() {
  scanf("%d", &n);
  for (int i(1); i <= (n); ++i) {
    scanf("%d", a + i);
    mx = max(mx, a[i]);
  }
  printf("%d\n", mx ^ a[n]);
  return 0;
}
