#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
bool ok(int x) {
  if (x < 0) return false;
  for (int i = 0; i * i <= x; i++)
    if (i * i == x) return true;
  return false;
}
int main() {
  int n;
  scanf("%d", &n);
  int mx = -10000000;
  for (int i = (0); i < (n); ++i) {
    int x;
    scanf("%d", &x);
    if (ok(x)) continue;
    mx = max(mx, x);
  }
  printf("%d\n", mx);
  return 0;
}
