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