n=int(input())
a=[int(i) for i in input().split()]
a.append(0)
ans=[1000,0]
for i in range(n):
    if a[i]>a[i+1]:
        ans[0]+=ans[1]*a[i]
    else:
        ans[1]+=ans[0]//a[i]
        ans[0]=ans[0]%a[i]
print(ans[0]+ans[1]*a[-2])