#include <bits/stdc++.h>
using namespace std;
char e = '\n';
long long i, j, le;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    long long n, mx, bot, got, div = -1, div1 = -1;
    cin >> n;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) cin >> v[i];
    mx = *max_element(v.begin(), v.end());
    if (mx <= v[0])
      cout << "1000" << e;
    else {
      bot = 1000 / v[0];
      got = 1000 % v[0];
      i = 1;
      while (i < n - 1) {
        while (i < n - 1) {
          if (v[i] >= v[i - 1]) {
            div = v[i];
            i++;
          } else if (v[i] < v[i - 1]) {
            break;
          }
        }
        if (div != div1) {
          got += (bot * div);
          div1 = div;
        }
        while (i < n - 1) {
          if (v[i] <= v[i - 1]) {
            div = v[i];
            i++;
          } else if (v[i] > v[i - 1]) {
            break;
          }
          i++;
        }
        if (div != div1) {
          bot = got / div;
          got = got % div;
          div1 = div;
        }
      }
      cout << got + bot * v[n - 1] << e;
    }
  }
  return 0;
}
