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

ans = 1000
cnt = 0

for i in range(n):
    if a[i] < a[i+1]:
        cnt = ans // a[i]
        ans -= a[i] * cnt
    else:
        ans += a[i] * cnt
        cnt = 0

print(ans)
