n=int(input())
l=list(map(int,input().split()))
t=1000
s=0
for i in range(len(l)-1):
	if i<len(l)-1:
		if l[i]<l[i+1]:
			s=t//l[i]
			t%=l[i]
	if l[i]>l[i+1]:
		t+=l[i]*s
		s=0
if s:
	t+=l[-1]*s
print(t)
