#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[1010];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int maxa = INT_MIN, b;
  for (int i = 0; i < n; i++) {
    b = sqrt(a[i]);
    if (b * b != a[i] || a[i] < 0) {
      if (a[i] > maxa) maxa = a[i];
    }
  }
  cout << maxa << endl;
  return 0;
}
