n = int(input())
a = list(map(int, input().split()))
m = 1000
k = 0
flag = True
p = max(a)

if a[0] == p:
    print(1000)
    exit()

for i in range(n):
    if flag == True and a[i] < p:
        k += m // a[i]
        m = m % a[i]
        flag = False
        p = a[i]
    elif flag == False and a[i] > p:
        m += k * a[i]
        k = 0
        flag = True
        p = a[i]
print(m)