from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
S = defaultdict(int)
max_flag = False
min_flag = True
max_v = 0
min_v = 0
for i in range(1,n):
    if min_flag and not max_flag:
        if a[min_v] >= a[i]:
            min_v = i
        elif a[min_v] < a[i]:
            S[min_v] = 'kau'
            min_flag = False
            max_flag = True
            if i == n-1:
                S[i] = 'uru'
    if not min_flag and max_flag:
        if a[max_v] <= a[i]:
            max_v = i
        elif a[max_v] > a[i]:
            S[max_v] = 'uru'
            min_flag = True
            max_flag = False
            min_v = i
            max_v = i

fee = 1000
kabu = 0
for i in range(n):
    if S[i] == 'kau':
        b,c = divmod(fee,a[i])
        fee = c
        kabu += b
    if S[i] == 'uru':
        fee += kabu * a[i]
        kabu = 0
print(fee)