#!/usr/bin/env python
n = int(input())
given_a = list(map(int, input().split()))

a = []
for k in given_a:
    if len(a) > 0 and a[-1] == k:
        continue
    else:
        a.append(k)

money = 1000
kabu = 0 

n = len(a)

if n == 1:
    print(money)
    exit()

for i in range(n):
    if n == 0:
        if a[i] > a[i+1]:
            continue
        else:
            kabu += money//a[i]
            money %= a[i]
    elif i == n-1:
        money += kabu*a[i]
        kabu = 0 
    else:
        if a[i] > a[i-1] and a[i] > a[i+1]:
            money += kabu*a[i]
            kabu = 0 
        if a[i] < a[i-1] and a[i] < a[i+1]:
            kabu += money//a[i]
            money %= a[i]

print(money)
