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