n = int(input())
a = [int(i) for i in input().split()]

ans = []

now = a[0]
flag = 'u'

for i in range(n-1):
    if flag == 'u':
        if now < a[i+1]:
            ans.append(a[i])
            if i == n-2:
                #print(i)
                ans.append(a[i+1])
            #print(i)
            flag = 'd'
        now = a[i+1]
        
    else:
        if now > a[i+1]:
            ans.append(now)

            #print(i)
            flag = 'u'
        now = a[i+1]

okane = 1000
#print(ans)
for i in range(len(ans)//2):
    okane += (okane // ans[2*i])*(ans[2*i+1]-ans[2*i])
    #print(okane)
    #okane -= kosu * ans[i]
print(okane)   
