#!/usr/bin/env python3
import sys
input = sys.stdin.readline


n = int(input())
a = [int(item) for item in input().split()]
prev = a[0]
a_uniq = [a[0]]
for item in a:
    if item == prev:
        continue
    a_uniq.append(item)
    prev = item

increasing = None
if a_uniq[0] < a_uniq[1]:
    increasing = True
else:
    increasing = False

money = 1000
kabu = 0
if increasing:
    p = money // a[0]
    money -= p * a[0]
    kabu = p

prev = a_uniq[0]
ans = 1000
for item in a_uniq[1:]:
    if item < prev and increasing:
        money += kabu * prev
        kabu = 0
        increasing = False
        ans = max(ans, money)
    if item > prev and not increasing:
        p = money // prev
        money -= p * prev
        kabu = p
        increasing = True
    prev = item
if kabu:
    money += a_uniq[-1] * kabu
    ans = max(ans, money)
print(ans)