import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

if __name__ == "__main__":
    n = int(input())
    a = list(map(int,input().split()))
    have = 1000
    kabu = 0
    hoge = 0
    for i in range(n-1):
        if a[i] < a[i+1]:
            kabu+=have//a[i]
            have-=kabu*a[i]
        elif a[i] == a[i+1]:
            hoge+=1
        else:
            have+=kabu*a[i]
            kabu = 0
    if a[-1]>a[-2]:
        have+=kabu*a[-1]
    print(have)