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

int main(void)
{
	long long int n;
	long long int *a;
	scanf("%d", &n);
	a = (long long int *)malloc(sizeof(long long int)*(n+1));
	long long int i = 0;
	while (i < n)
	{
		scanf("%d", &(a[i]));
		i++;
	}

	long long int money = 1000;
	long long int stock = 0;
	long long int tmp_m = 0;
	long long int tmp_s = 0;
	i = 0;
	while (i < n - 1)
	{
		//if (a[i] == a[i+1])
		if (a[i] > a[i+1])
		{
			money = money + stock * a[i];
			stock = 0;
		}
		if (a[i] < a[i+1])
		{
			stock = stock + (money / a[i]);
			money = money % a[i];
		}
		i++;
	}
	A
	money = money + stock * a[i];
	printf("%d\n",money);
}
