n = int(input())
A = list(map(int, input().split()))
D = [A[i]-A[i-1] for i in range(1, n)] + [-1]
m = 1000
left = 0
while left<n:
    for right in range(left, n):
        if D[right]<0 and left<right:
            m += max((A[right]-A[left]), 0)*(m//A[left])
            left = right+1
print(m)