from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = LIST()

s = [[0]*2 for i in range(n)]
m = [[0]*2 for i in range(n)]

# 売り
s[0][0] = 0
m[0][0] = 1000
# 買い
s[0][1] = 1000//a[0]
m[0][1] = 1000 - s[0][1] * a[0]

for i in range(1,n):
    s[i][0] = 0
    m[i][0] = max(m[i-1][0], m[i-1][1]+s[i-1][1]*a[i])
    s[i][1] = max(s[i-1][0]+m[i-1][0]//a[i], s[i-1][1])
    if s[i-1][0] + m[i-1][0]//a[i] > s[i-1][1]:
        m[i][1] = m[i-1][0] - m[i-1][0]//a[i] * a[i]
    else:
        m[i][1] = m[i-1][1]

print(m[n-1][0])
