#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[1003];
  scanf("%d", &n);
  int maxx = -0x1f1f1f1f;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    maxx = maxx < a[i] ? a[i] : maxx;
  }
  maxx = maxx ^ a[n - 1];
  printf("%d\n", maxx);
}
