#include <bits/stdc++.h>
int n, mx;
int a[100010];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > mx) mx = a[i];
  }
  printf("%d", a[n] ^ mx);
  return 0;
}
