import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
m = 1000
kabu = 0
buy = True

for i in range(len(a)-1):
    if buy and np.any(a[i] < a[i+1:]):
        kabu = int(m/a[i])
        m -= kabu * a[i]
        buy = False
    elif not buy and np.any(a[i] > a[i+1:]):
        m += kabu * a[i]
        kabu = 0
        buy = True
    else:
        continue

if kabu != 0:
    m += kabu * a[-1]

print(m)
