#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const long long INF = (1LL << 60LL);
int main() {
  long long N;
  scanf("%lld", &N);
  vector<long long> a;
  for (long long i = 0; i < N; i++) {
    long long v;
    scanf("%lld", &v);
    a.emplace_back(v);
  }
  a.emplace_back(-99999);
  vector<long long> b;
  long long mode;
  if (a[0] < a[1]) {
    mode = 1;
    b.emplace_back(-a[0]);
  }
  if (a[0] > a[1]) {
    mode = -1;
  }
  for (long long i = 0; i < N; i++) {
    if (mode == 1) {
      if (a[i] > a[i + 1]) {
        b.emplace_back(a[i]);
        mode = -1;
        continue;
      }
    }
    if (mode == -1) {
      if (a[i] < a[i + 1]) {
        b.emplace_back(-a[i]);
        mode = +1;
        continue;
      }
    }
  }
  long long stock = 0;
  long long money = 1000;
  for (long long i = 0; i < b.size(); i++) {
    if (b[i] < 0) {
      long long p = -b[i];
      stock += money / p;
      money = money % p;
    }
    if (b[i] > 0) {
      long long p = b[i];
      money += stock * p;
      stock = 0;
    }
  }
  cout << money << endl;
}
