N = int(input())
A = list(map(int, input().split()))
M = {
        'stack':0,
        'money':1000
    }

for i in range(N):
    if i == N-1:
        if M['stack'] != 0:
            M['money'] += A[i] * M['stack']
        break
    if A[i] < A[i + 1]:
        # 株購入
        if M['money'] != 0:
            M['stack'] = M['money'] // A[i]
            M['money'] %= A[i]
    
    elif A[i] > A[i + 1]:
        # 株売却
        M['money'] += A[i] * M['stack']
        if M['stack'] != 0:
            M['stack'] = 0
print(M['money'])