package main

import "fmt"

func main() {
	var n, money, kabu int
	money = 1000
	fmt.Scan(&n)
	var a []int
	for i := 0; i < n; i++ {
		var b int
		fmt.Scan(&b)
		a = append(a, b)
	}
	a = append(a, 0)

	for i := 0; i < n; i++ {
		if a[i] < a[i+1] {
			kabu = money / a[i]
			money = money % a[i]
		}
		if a[i] > a[i+1] {
			money = money + kabu*a[i]
		}
	}

	fmt.Println(money)

}
