import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    n = int(stdin.readline().rstrip())
    A = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    money = 1000
    kabu = 0
    down = 0
    up = 0
    kijun = A[0]
    for i in range(1,n):
        a = A[i]
        if i == 1:
            if kijun < a:
                buy = kijun
                katta = money//buy
                kabu += katta
                money -= katta*buy
                down = 0
                up = 1
                kijun = a
        if up == 1:
            if kijun > a:
                sell = kijun
                money += sell * kabu
                kabu = 0
                up = 0
                down = 1
                kijun = a
        elif down == 1:
            if kijun < a:
                buy = kijun
                katta = money//buy
                kabu += katta
                money -= katta*buy
                down = 0
                up = 1
                kijun = a
    if kabu > 0:
        money += kabu * A[-1]
    print(money)




if __name__ == '__main__':
    solve()
