include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin>>n;
  vector<long long>a(n);
  for(int i=0;i<n;i++)cin>>a[i];
  long long okane=1000;
  long long shou=a[0];
  for(int i=0;i<n-1;i++){
    shou=a[i];
    for(int j=i+1;j<n;j++){
      if(shou<a[j]){
        okane=(okane/shou)*a[j]+okane%shou;
        //cout<<shou<<i<<j;
        i=j-1;
        shou=a[j];
        break;
      }
      shou=min(a[j],shou);
    }
  }  
  cout<<okane<<endl;
}