from math import sqrt

len = int(input())
nums = map(int,input().split())

max = 0

for i in nums:
    if int(sqrt(i)) ** 2 != i:
        if max < i:
            max = i

print(max)