#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a[1000001], s;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    s = sqrt(a[i]);
    if (s * s != a[i]) {
      cout << a[i];
      break;
    }
  }
  return 0;
}
