#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i, arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  for (i = n - 1; i >= 0; i--) {
    int flag = 0;
    if (arr[i] > 0) {
      int p = sqrt(arr[i]);
      int l = abs(pow(p, 2) - arr[i]);
      if (l != 0) flag = 1;
    }
    if (flag == 1) break;
    if (arr[i] < 0) break;
  }
  cout << arr[i] << endl;
}
