package main

import "fmt"

func main(){
	var n,have,money,buy,sell int
	fmt.Scan(&n)
	money = 1000
	a := make([]int,n)
	for i:=0 ; i<n ; i++ {
		fmt.Scan(&a[i])
//fmt.Println(money)
		if i==0 {
			buy = a[i]
			sell = a[i]
		} else if i < n-1{
			if sell <= a[i] {
				sell = a[i]
			} else {
				//売る
//fmt.Println("sell")
				have = int(money/buy)
//fmt.Println(have)
				money -= have*buy
				money += have*sell
				have = 0
				buy = a[i]
				sell = a[i]
			}
		} else {
			if buy < a[i] {
				have = int(money/buy)
				money -= have*buy
				money += have*a[i]
			}
		}
	}
	fmt.Println(money)
}
