def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = 1000
    t, p = [], []
    if A[0] < A[1]:
        t.append(0)
    for i in range(1, n - 1):
        if A[i - 1] >= A[i] < A[i + 1]:
            t.append(i)
        elif A[i - 1] <= A[i] > A[i + 1]:
            p.append(i)
    b = 0
    print(t, p)
    for i in range(n):
        if i in t:
            b += ans // A[i]
            ans %= A[i]
        if i in p:
            ans += b * A[i]
            b = 0
    if b > 0:
        ans += b * A[-1]
    print(ans)


if __name__ == '__main__':
    main()
