#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
A = list(map(int, input().split()))
B = [0]*N # 1: top, -1: bottom

inc = 0 # 1: increasing, -1: decreasing
val = A[0]
bot = 0
for i, a in enu(A):
    if i == N-1:
        B[i] = 1
    if inc == 0:
        if val < a:
            inc = 1
            B[i-1] = -1
        elif val == a:
            continue
        else:
            inc = -1
            B[i-1] = 1
    elif inc == 1:
        if val < a:
            continue
        elif val == a:
            continue
        else:
            B[i-1] = 1
            inc = -1
    else:
        if val < a:
            inc = 1
            B[i-1] = -1
        elif val == a:
            continue
        else:
            continue
    val = a

# print(B)
money = 1000
stock = 0
for i, a in enu(A):
    if B[i] == -1:
        # print('buy')
        stock += money//A[i]
        money %= A[i]
    elif B[i] == 1:
        # print('sell')
        money += stock*A[i]
        stock = 0 

print(money)
