import sys
input=sys.stdin.readline
n=int(input())
arr=list(map(int,input().split()))
have=0
ans=0
rate=0
for i in range(n-1):
    #print(have)
    if(have!=0):
        if(arr[i+1]<arr[i]):
            ans+=have*(arr[i]-rate)
            have=0
    else:
        if(arr[i+1]>arr[i]):
            have=1000//arr[i]
            rate=arr[i]
#print(have)
if(have!=0):
    ans+=have*(arr[-1]-rate)
    have=0
print(ans+1000)            
    
           
        

    