#include <bits/stdc++.h>
using namespace std;
int a[200000];
map<int, int> s;
int main() {
  int n;
  int maxsq = (-1) * 10000000;
  int sq;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (a[i] < 0) {
      if (a[i] > maxsq) maxsq = a[i];
    } else {
      sq = sqrt(a[i]);
      sq = sq * sq;
      if (sq != a[i] && a[i] > maxsq) maxsq = a[i];
    }
  }
  cout << maxsq;
  return 0;
}
