import sys

input = sys.stdin.readline


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

    ans = 1000
    ll = rr = -1
    for a in A:
        if ll == -1:
            ll = rr = a
        elif rr <= a:
            rr = a
        else:
            q, r = divmod(ans, ll)
            ans = rr * q + r
            ll = -1

    if ll != -1:
        q, r = divmod(ans, ll)
        ans = rr * q + r

    print(ans)


if __name__ == "__main__":
    main()
