#include <bits/stdc++.h>
using namespace std;
int test(int a) {
  int b = sqrt(a);
  b = b * b;
  if (b == a) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i <= n - 1; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  int i = 0;
  while (i <= n - 1) {
    int alpha = test(arr[n - 1 - i]);
    if (alpha == 1) {
      i++;
    } else {
      cout << arr[n - i - 1] << endl;
      break;
    }
  }
  return 0;
}
