package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	a := make([]int, n)
	var slim []int
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
		if i > 0 {
			if a[i] != a[i-1] {
				slim = append(slim, a[i])
			}
			continue
		}
		slim = append(slim, a[i])
	}

	kabu := 0
	var cash uint64
	cash = 1000

	for i := 0; i < len(slim); i++ {
		if i == len(slim) - 1 {
			if slim[i] > slim[i-1] {
				cash += uint64(slim[i] * kabu)
				kabu = 0
				continue
			}
			cash += uint64(slim[i-1] * kabu)
			kabu = 0
			continue
		}
		if slim[i] > slim[i+1] {
			if kabu > 0 {
				// 売る
				cash += uint64(slim[i] * kabu)
				kabu = 0
			}
		} else {
			if kabu == 0 {
				// 買う
				kabu = int(cash) / slim[i]
				cash = cash % uint64(slim[i])
			}
		}
	}
	fmt.Println(cash)

}
