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


def full_purchase(kabuka):
    kabu = 1000 // kabuka
    return kabu

def sell(kabuka, kabu):
    money = kabuka * kabu
    return money

ans = 0
min_kabuka = min(a)
min_kabuka_index = a.index(min(a))

b = a
for i in range(len(b)):
    max_kabuka_index = b.index(max(b))
    if min_kabuka_index < max_kabuka_index:
        ans = sell(a[max_kabuka_index], full_purchase(a[min_kabuka_index]))
        if ans <= 1000:
            print(1000)
            exit()
        else:
            print(ans)
            exit()
    else:
        b.remove(max(b))
print(1000)
