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