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

money = 1000
asset = 0

for i in range(n):
    if asset == 0:
        if a[i] == max(a[i:n]):
            pass
        else:
            asset = money // a[i]
            money = money - asset * a[i]
    else:
        if a[i] == min(a[i:n]) and i != n-1:
            pass
        else:
            money += asset * a[i]
            asset = 0
    # print("money", money)
    # print("asset", asset, "\n")

print(money)