using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;

class Program
{
    public static void Main( )
    {
        int N = int.Parse( Console.ReadLine( ) );
        var A = Console.ReadLine( ).Split( ).Select( int.Parse ).ToArray( );

        int buy = A[ 0 ];
        int sold = A[ 0 ];
        int c = 0;
        int k = 1000;
        for ( int i = 0; i < A.Length; i++ )
        {
            int price = A[ i ];
            sold = Math.Max( sold, price );

            if ( price < buy )
            {
                buy = price;
                continue;
            }
            else if ( price >= buy && price < sold )
            {
                // buy
                c = k / buy;
                k = k - ( c * buy );
                // sold
                k = k + ( c * sold );
                // reset
                buy = sold;
                sold = 0;
                c = 0;
            }
            else if (i==A.Length-1 && buy < price)
            {
                // buy
                c = k / buy;
                k = k - ( c * buy );
                // sold
                k = k + ( c * sold );
                // reset
                buy = sold;
                sold = 0;
                c = 0;

            }

        }

        Console.WriteLine(k);


    }


}