n = int(input())
a = list(map(int, input().split())) + [-1]
m, s = 1000, 0
for i in range(n):
    if a[i] < a[i+1]:
        s = m//a[i]
        m -= a[i]*s
    elif a[i] > a[i+1]:
        m += a[i]*s
        s = 0
print(m)