import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
import copy
n = int(input())
#n, k = map(int, sys.stdin.readline().split())
#s = input()
a = list(map(int, sys.stdin.readline().split()))

c = 1000
i = 0
while (i < n):
    ma = a[i]
    mi = a[i]
    mapo = i
    mipo = i
    j = 0
    while (i+j < n):
        if a[i+j] < mi:
            mi = a[i+j]
            mipo = i+j

        if a[i+j] > ma:
            ma = a[i+j]
            mapo = i+j
            break

        j += 1

    if mapo == i:
        print(c)
        sys.exit()

    x = c // mi
    y = x * (ma - mi)
    c += y

    i += (j + 1)

print(c)
        
            
    
        
