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

a = a + [0]
b = 1000
c = 0
for i in range(1, n):
    numb = a[i-1]
    numa = a[i]
    numaa = a[i+1]
    if numb < numa:
        c = b//numb
        b = b%numb
    if numa > numaa:
        b += c*numa
        c = 0


print(b)
