#include <bits/stdc++.h>
using namespace std;
int main() {
  int mx = -1e9;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x < 0 || (int)(sqrt(x)) * (int)(sqrt(x)) != x) mx = max(mx, x);
  }
  printf("%d\n", mx);
  return 0;
}
