#include <stdio.h>
#include <stdlib.h>

int main(){
    int i = 0;
    int n;
    int *A = malloc(sizeof(int) *100);
    scanf("%d", &n);
    for (i = 0; i < n;i++){
        scanf("%d", &A[i]);
    }

    long long int kane = 1000;
    long long int kabu = 0;

    int selled = 1;

    long long int num;

    for (i = 0; i < n-1;i++){
        num = 0;
        if(selled==1){
            if(A[i]<A[i+1]){
                num = kane / A[i];
                kabu = num - 1;
                kane -= A[i] * (num - 1);
                selled = 0;
            }
        }else{
            if(A[i]>A[i+1]){
                kane += kabu * A[i];
                kabu = 0;
                selled = 1;
            }
        }
    }
    kane += kabu * A[n - 1];
    int kanekane = 1000;
    if(kane>kanekane){
        printf("%lld", kane);
    }else{
        printf("%d", kanekane);
    }
    return 0;
}