#include <bits/stdc++.h>
using namespace std;
void Ans(bool x) {
  if (x)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
const long long int INF = 1001001001;
const long long int mod = 1000000007;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  vector<pair<int, int> > p;
  int nowl = a[0];
  int nowh = 0;
  int now = 0;
  while (now <= n) {
    while (a[now] <= nowl && now < n) {
      nowl = a[now];
      now++;
    }
    nowh = a[now];
    if (n == now) break;
    while (a[now] >= nowh && now < n) {
      nowh = a[now];
      now++;
    }
    p.push_back(pair<int, int>(nowl, nowh));
    nowl = a[now];
  }
  int ans = 1000;
  for (pair<int, int> x : p) {
    ans = (ans / x.first) * x.second + ans % x.first;
  }
  cout << ans << endl;
}
