n = int(input())
a = list(map(int, input().split()))
ans = 1000
joushou = (a[0] < a[1])
kabu = 0
if joushou:
    zzz = 1000 // a[0]
    kabu += zzz
    ans -= zzz * a[0]

for i in range(1, n - 1):
    if joushou and a[i] > a[i + 1]:
        zzz = ans // a[i]
        kabu += zzz
        ans -= zzz * a[i]
        joushou = False
    elif not joushou and a[i] < a[i + 1]:
        ans += kabu * a[i+1]
        kabu = 0
        joushou = True


print(ans)
