#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, v, ans, temp;
  while (cin >> n) {
    ans = INT_MAX * -1;
    for (int i = 0; i < n; i++) {
      cin >> v;
      temp = sqrt(abs(v));
      if (temp * temp != v && ans < v) ans = v;
    }
    cout << ans << endl;
  }
  return 0;
}
