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