# -*- coding: utf-8 -*-
# D

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

N = int(input())
A = [300] + list(map(int, input().split()))

flg = [0] * (N+1)
buy_cnt = 0

for i in range(1, N+1):
    if i == N:
        if A[i] < A[i - 1]:
            flg[i] = 1
        if A[i-1] < A[i]:
            flg[i] = -1
    else:
        if A[i] <= A[i-1] and A[i+1] > A[i]:
            flg[i] = 1
            buy_cnt += 1
        if A[i-1] <= A[i] and A[i+1] < A[i]:
            flg[i] = -1

if buy_cnt == 0:
    print(1000)
    sys.exit()

ans = 1000
stock = 0
for i in range(1, N+1):
    if flg[i] == 1:
        stock = ans//A[i]
        ans = ans % A[i]
    elif flg[i] == -1:
        ans += stock * A[i]
        stock = 0
print(ans)
