#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int ans;
  for (int i = n - 1; i >= 0; i--) {
    int s = sqrt(arr[i]);
    if (s * s != arr[i]) {
      ans = arr[i];
      break;
    }
  }
  cout << ans;
  return 0;
}
