#include <bits/stdc++.h>
using namespace std;
int issq(int n) {
  if (n < 0) return false;
  int rt = sqrt(n);
  return rt * rt == n;
}
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int ans = -1e9;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (!issq(x)) ans = max(ans, x);
  }
  cout << ans << endl;
}
