n = int(input())
a = list(map(int, input().split()))
pro = 0
b = a[0]
for i in range(n):
    if a[i]>b:
        pro = 1
        break
if pro==0:
    print('1000')
else:
    sum = 1000
    t = 0
    if n>3 :
        while sum > 0 and t< n-3:
            if a[t]>a[t+1]:
                continue
            else:
                if a[t+1]>a[t+2]:
                    num = sum // a[t]
                    sum = sum + a[t+1]*num - a[t]*num
                    t=t+1
                
                else :
                    num = sum // a[t]
                    sum = sum + a[t+2]*num - a[t]*num
                    a.pop(t+2)
            t = t+1
    elif n == 3:
        if a[1]>a[2]:
            num = sum // a[0]
            sum = sum + a[1]*num - a[0]*num
                
        else :
            num = sum // a[0]
            sum = sum + a[2]*num - a[0]*num
    else:
        num = sum // a[0]
        sum = sum + a[1]*num - a[0]*num
    print(sum)