#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-07-25 21:25:14 +0900
# LastModified: 2020-07-25 22:33:12 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    a = list(map(int, input().split()))
    have = 1000
    pivot_index = 0
    obj_index = -1
    while pivot_index < n:
        tmp = -1
        for i in range(pivot_index+1, n):
            if a[i] - a[pivot_index] > 0:
                tmp = i
                break
        if tmp == -1:
            print(have)
            return
        obj_index = tmp
        tmp = obj_index
        for i in range(tmp+1, n):
            if a[i] - a[tmp] <= 0:
                break
            else:
                obj_index = i
        min_flactu = min(a[pivot_index:obj_index+1])
        have = have % min_flactu + have // min_flactu * a[obj_index]
        pivot_index = obj_index+1
    print(have)


if __name__ == "__main__":
    main()
