#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
bool check(int x) {
  int y = sqrt(x);
  if (y * y != x)
    return true;
  else
    return false;
}
int n, a[1005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++)
    if (check(a[i])) {
      cout << a[i];
      break;
    }
  return 0;
}
