#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
double num[1005];
int sqrts;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lf", &num[i]);
  sort(num + 1, num + n + 1);
  for (int i = n; i >= 1; --i) {
    if (num[i] >= 0) {
      sqrts = (int)sqrt(num[i]);
      if ((num[i] - sqrts * sqrts) > eps) {
        printf("%d\n", (int)num[i]);
        break;
      }
    } else {
      printf("%d\n", (int)num[i]);
      break;
    }
  }
  return 0;
}
