#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    x = a[i];
    if ((int)sqrt(x) * (int)sqrt(x) != x) {
      cout << a[i], exit(0);
    } else if (a[i] < 0)
      cout << a[i], exit(0);
  }
}
