#include <bits/stdc++.h>
using namespace std;
int n, m;
int arr[100005];
int a, b, x, y;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  reverse(arr, arr + n);
  for (int i = 0; i < n; i++) {
    int temp = sqrt(arr[i]);
    if (temp * temp == arr[i])
      continue;
    else {
      cout << arr[i] << endl;
      break;
    }
  }
}
