package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()

	var a []int
	for i := 0; i < n; i++ {

		tmp := nextInt()
		if len(a) == 0 {
			a = append(a, tmp)
			continue
		}

		// skip same value
		if tmp == a[len(a)-1] {
			continue
		}
		a = append(a, tmp)
	}

	var tani []int
	var yama []int
	for i := 0; i < len(a); i++ {
		if i == len(a)-1 {
			if a[i-1] > a[i] {
				tani = append(tani, a[i])
			} else {
				yama = append(yama, a[i])
			}
			continue
		}
		if len(tani) == 0 {
			if a[i] > a[i+1] {
				//下がってたら除外
				continue
			}
			// 最初の底
			tani = append(tani, a[i])
			continue
		}

		if a[i-1] < a[i] && a[i] > a[i+1] {
			yama = append(yama, a[i])
			continue
		}

		if a[i-1] > a[i] && a[i] < a[i+1] {
			tani = append(tani, a[i])
			continue
		}

	}
	//fmt.Println(tani)
	//fmt.Println(yama)
	money := 1000
	for i := 0; i < len(yama); i++ {
		kabu := money / tani[i]
		money = money % tani[i]

		money += kabu * yama[i]
	}

	fmt.Println(money)
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
