#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, i, ans = -1000000007, y;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    if (x < 0) {
      if (x > ans) ans = x;
      continue;
    }
    y = sqrt(x);
    if (y * y == x) continue;
    if (x > ans) ans = x;
  }
  cout << ans << '\n';
  return 0;
}
