from collections import deque, Counter, defaultdict
from itertools import chain, combinations
import json
# import numpy as np
import bisect
import sys
import math
import bisect
from functools import lru_cache
import itertools

sys.setrecursionlimit(10 ** 8)

M = 10 ** 9 + 7
INF = 10 ** 17


def main():
    N = int(input())
    A = [int(a) for a in input().split()]
    # N, K = [int(a) for a in input().split()]
    # A = [int(a) for a in input().split()]
    # T1, T2, T3 = [int(a) for a in input().split()]

    aa = []
    t = A[0]
    start = A[0]
    for ai in A[1:]:
        if t <= ai:
            t = ai
            if start is None:
                start = ai
            continue
        aa.append(
            (start, t)
        )
        t = ai
        start = None
    if start is not None:
        aa.append((start, A[-1]))

    m = 1000
    for a, b in aa:
        c = m // a
        m += (b - a) * c
    print(m)


if __name__ == "__main__":
    main()
