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

k_y = [1000]

for i in range(n):
	genkin_list = [ hk * a[i] + hy for hk,hy in enumerate(k_y) ]  #所持株、金
	genkin_list_max = max(genkin_list)
	max_index = genkin_list.index(genkin_list_max)
	
	k_y = [ a[i]*(max_index-hk)+k_y[max_index] for hk,hy in enumerate(k_y) ]
	k_y2 = [ genkin_list_max - a[i] * x for x in range( len(k_y), genkin_list_max // a[i]+1 ) ]
	k_y = k_y + k_y2
print( k_y[0] )
