n = int(input())
a = list(map(int, input().split()))

real = 1000
unreal = 0

for i in range(n-1):

    if a[i] < a[i+1]:
        unreal, real = divmod(real, a[i])

    elif a[i] > a[i+1]:
        real += (unreal * a[i])
        unreal = 0

    else:
        continue

real += unreal * a[n-1]
print(real)