#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  int arr[n];
  int coin=1000;
  int stock=0;
  int prev;
  for(int i=0;i<n;i++)
    cin>>arr[i];
  int stock=1000/arr[0];
  prev=arr[0];
  coin=1000-stock*arr[0];
  for(int i=1;i<n;i++)
  {
      if(arr[i]<=prev)
      {
         coin+=stock*prev;
         stock=coin/arr[i];
         prev=arr[i];
      }
      else
      {
        coin+=stock*arr[i];
        stock=0;
        prev=arr[i];
      }
  }
  cout<<coin;
  return 0;
}