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

arr = [tmp[0]]

for i in range(1, n):
    if arr[-1] != tmp[i]:
        arr.append(tmp[i])

m, s = 1000, 0
for i in range(1, len(arr)):
    if arr[i - 1] < arr[i]:
        s += m // arr[i - 1]
        m -= m // arr[i - 1] * arr[i - 1]
        m += s * arr[i]
        s = 0