n=int(input())
m=list(map(int,input().split()))
list1=[]
# print(sorted(m,reverse=True))
list_new=sorted(m,reverse=True)
for i in list_new:
    if i**0.5!=int(i**0.5):
        list1.append(i)
print(list1[0])