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