#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

N = int(input())
As = list(map(int, input().split()))

# peak = n - 1
# for n in range(N - 2, -1, -1):
#     if As[n] > As[n + 1]:
#         peak = n
#     else:
#         break

def uniq(As):
    ret = []
    for a in As:
        if not ret:
            ret.append(a)
        else:
            if ret[-1] != a:
                ret.append(a)
    return ret

As = uniq(As)
N = len(As)

ans = 0
money = 1000
stock = 0
for n in range(N):
    ans = max(ans, money + stock * As[n])

    if n == N - 1:
        break

    if As[n] < As[n + 1]:
        stock, money = divmod(money, As[n])
    elif As[n] > As[n + 1]:
        money += stock * As[n]
        stock = 0
    # print("m, s = ", money, stock)

print(ans)



