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

curr = 1000
stock = 0

for i in range(n - 1):
    if ls[i] < ls[i + 1]:
        stock += curr // ls[i]
        curr -= stock * ls[i]
    elif ls[i] > ls[i + 1]:
        curr += stock * ls[i]
        stock = 0 

curr += stock * ls[i + 1]
stock = 0

print(curr)
