#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b;
  cin >> a;
  int cur;
  long double per;
  int res = -1e7;
  for (int i = 0; i < a; ++i) {
    cin >> cur;
    if (cur < 0) {
      res = max(cur, res);
      continue;
    }
    per = sqrtl((long double)cur);
    if (per != (long long)(per)) {
      res = max(cur, res);
    }
  }
  cout << res << endl;
}
int main() {
  cout.setf(ios::fixed);
  cout.precision(9);
  solve();
  return 0;
}
