#!/usr/bin/env python

def main():
    n = int(input())
    a = list(map(int, input().split()))
    m = 1000
    s = 0

    for d in range(n-1):
        if a[d] < a[d+1]:
            s = m // a[d]
            m -= s * a[d]
        elif a[d] > a[d+1]:
            m += a[d] * s
            s = 0

    m += a[n-1] * s

    print(m)

if __name__ == '__main__':
    main()
