import numpy as np
from scipy import signal


def main():
    N = int(input())
    A = list(map(int, input().split()))

    dA = list()
    for i in range(N-1):
        dA.append(A[i+1]-A[i])

    idn = list()
    upflag = False
    downflag = False
    if dA[0] > 0:
        upflag = True
        tmp = 0
    elif dA[0] < 0:
        downflag = True
    for i, a in enumerate(dA[1:], 1):
        if downflag and a > 0:
            tmp = i
            upflag = True
            downflag = False
        elif upflag and a < 0:
            idn.append((tmp, i))
            upflag = False
            downflag = True
    if upflag:
        idn.append((tmp, N-1))

    ans = 1000
    for n in idn:
        ans = (ans//A[n[0]]) * A[n[1]] + (ans % A[n[0]])

    print(ans)


if __name__ == "__main__":
    main()
