#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    N,=pin()
    A=[*pin()]

    mon=1000
    stocks=0
    final=0
    for i in range(N-1):

        if A[i]>=A[i+1]:
            if stocks>0:
                mon+=stocks*A[i]
                stocks=0
            final=0
            
        elif A[i]<A[i+1]:
            stocks=mon//A[i]
            mon=mon%A[i]
            final=1

    print(mon+final*stocks*A[-1])
            
#%%submit!
resolve()
