#include <bits/stdc++.h>
int main() {
  int cmpfunc(const void* a, const void* b);
  int n, a[1000], i, c, d;
  while (scanf("%d", &n) == 1) {
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    qsort(a, n, sizeof(int), cmpfunc);
    for (i = n - 1; i >= 0; i--) {
      c = a[i];
      d = sqrt(c);
      if (d * d != c) break;
    }
    printf("%d\n", c);
  }
  return 0;
}
int cmpfunc(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
