#include <bits/stdc++.h>
using namespace std;
long long POW(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  if (b & 1) return (a * POW(a, b - 1)) % 1000000007LL;
  long long t = POW(a, b / 2);
  return (t * t) % 1000000007LL;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int dx[] = {0, -1, 1, 0}, dy[] = {1, 0, 0, -1};
int ddx[] = {0, 0, 1, 1, 1, -1, -1, -1}, ddy[] = {1, -1, 1, 0, -1, 1, 0, -1};
int main() {
  int ans = -1987654321;
  int n;
  scanf("%d", &n);
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    int x;
    scanf("%d", &x);
    if (x < 0)
      ans = max(ans, x);
    else {
      int t = sqrt(x);
      if (t * t != x) ans = max(ans, x);
    }
  }
  printf("%d", ans);
}
