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