#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l = -10000010, m, n, h, x, c = 0;
  cin >> n;
  for (j = 0; j < n; j++) {
    cin >> m;
    h = sqrt(m);
    if (m < 0) {
      if (l < m) l = m;
    } else if (h * h != m) {
      if (l < m) l = m;
    }
  }
  cout << l;
}
