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