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):
        flag = 0
        if kabu>0:
            if a[i-1] < a[i]:
                for j in range(kabu):
                    have += a[i]
                kabu = 0
            elif a[i-1] == a[i]:
                hoge +=1
            else:
                for j in range(i,n):
                    if a[j]>a[i]:
                        flag = 1
                        break
                if flag == 1:
                    n_have = have
                    for k in range(n_have//a[i]):
                        have-=a[i]
                        kabu+=1
        else:
            if a[i-1]==a[i] and i>0:
                continue
            for j in range(i,n):
                if a[j]>a[i]:
                    flag = 1
                    break
            if flag == 1:
                n_have = have
                for k in range(n_have//a[i]):
                    have-=a[i]
                    kabu+=1
    print(have)