n = int(input())
a = [int(i) for i in input().split()]

def main():
    money = 1000
    n = 0
    
    x = a[0]
    for i in range(1, len(a)):
        if (x < a[i]):   # 買う
            n = money // a[i-1]
            money += (a[i] - a[i-1]) * n
            x = a[i]

    print(money)

if __name__ == '__main__':
    main()
