import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
a = rl()
m = 1000
s = 0
for i in range(n-1):
    if a[i+1] > a[i]:
        s = m//a[i]
        m -= s*a[i]
    else:
        m += s*a[i]
        s = 0
else:
    m += s*a[-1]
print(m)

