n = int(input())
a = list(map(int, input().split())) 

stack = 0
ans = 1000

Flag = False
i,j  = 0, 0

while i < n-1:
    if a[i] < a[i+1]:
        stack = ans // a[i]
        ans -= stack*a[i]
        j = i
        while j < n-1:
            if a[j] > a[j+1]:
                ans += stack*a[j]
                stack = 0
                i = j
                Flag = True
                break
            j += 1

    if Flag:
        Flag = False
        continue

    i += 1

if a[-2] < a[-1]:
    ans += stack*a[-1]

print(ans)