N = int(input())
An = list(map(int, input().split()))
money = 1000
stock = 0
price = An[0]
uri_flg = False
kai_flg = False
for i in range(N-1):
#     if not uri_flg:
#         print("skip1")
#         continue
    if uri_flg and An[i] <= An[i+1]:
#         print("skip2")
#         print(An[i], An[i+1])
        continue
#     print(i, Ai, money, stock, uri_flg)
    if An[i] < An[i+1] or kai_flg:
#         print("kai")
        uri_flg = False
#         stock = money // An[i]
#         money %= An[i]
#         price = An[i]
    else:
#         print("uri")
        uri_flg = True
#         money += stock * An[i-1]
#         stock = 0
#         price = 0
    if uri_flg:
        if (An[i] > An[i+1]):
#             print("uru")
            money += stock * An[i-1]
            stock = 0
            price = 0
            kai_flg = True
            uri_flg = False
    else:
        if (An[i] < An[i+1]):
#             print("kau")
            stock = money // An[i]
            money %= An[i]
            price = An[i]
            kai_flg = False
        
#     print(i, Ai, money, stock, uri_flg)
if (stock > 0):
    money += stock * An[N-1]
print(money)









