#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000000 + 100;
int A[Maxn];
int Vis[10000000 + 100];
int N;
inline int cmp(int x, int y) { return x > y; }
int main() {
  for (int i = 0; i <= 1000; ++i) Vis[i * i] = 1;
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%d", &A[i]);
  sort(A + 1, A + N + 1, cmp);
  for (int i = 1; i <= N; ++i) {
    if (A[i] < 0) {
      cout << A[i] << endl;
      return 0;
    }
    if (!Vis[A[i]]) {
      cout << A[i] << endl;
      return 0;
    }
  }
  return 0;
}
