n = int(input())
a = list(map(int, input().split()))
mny = 1000
stc = 0

sa = set(a)
sizea = len(sa)
ssa = sorted(list(sa))


for i in range(n):
    imj = False
    ilj = False
    for j in range(i+1,n):
        if a[i] < a[j]:
            imj = True
        elif a[i] > a[j]:
            ilj = True
        if imj and ilj:
            break
    
    if mny >= a[i] and imj:
        stc += mny//a[i]
        mny = mny - (a[i] * (mny//a[i]))
    elif ilj:
        mny += stc * a[i]
        stc -= stc


mny += stc * a[len(a)-1]

print(mny)