#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
int a[N];
int n;
int b[N];
map<string, int> q, e;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  for (int i = n; i >= 1; i--) {
    if ((int)sqrt(a[i]) * (int)sqrt(a[i]) != a[i]) {
      cout << a[i] << endl;
      break;
    }
  }
  return 0;
}
