#include <bits/stdc++.h>
int isPerfectSquare(int number) {
  int iVar;
  float fVar;
  fVar = sqrt((double)number);
  iVar = fVar;
  if (iVar == fVar)
    return 1;
  else
    return 0;
}
int main() {
  int no;
  scanf("%d\n", &no);
  int a[no];
  int max;
  max = -1000000;
  for (int i = 0; i < no; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < no; i++) {
    if (isPerfectSquare(a[i]))
      continue;
    else {
      if (a[i] > max) max = a[i];
    }
  }
  printf("%d", max);
  return 0;
}
