#include <bits/stdc++.h>
using namespace std;
long long a[1001];
bool ck(long long ai) {
  if (ai < 0) return true;
  for (long long i = 0; i * i <= ai; ++i) {
    if (i * i == ai) return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = (0); i < (n); ++i) cin >> a[i];
  long long mx = -1000100010;
  for (int i = (0); i < (n); ++i) {
    if (ck(a[i])) mx = max(mx, a[i]);
  }
  cout << mx << endl;
  return 0;
}
