#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<long long>;
using pii = pair<int, int>;
using psi = pair<string, int>;
int f(int a, int b) {
  int ans = 0;
  while (a >= b) {
    ans++;
    a -= b;
  }
  return ans;
}
int main() {
  int N;
  cin >> N;
  vi data(N);
  for (int i = 0; i < N; i++) {
    cin >> data[i];
  }
  int k = 0;
  int money = 1000;
  if (data[0] <= data[1]) {
    k = f(money, data[0]);
    money -= k * data[0];
  }
  for (int i = 1; i < N - 1; i++) {
    if (max({data[i], data[i - 1], data[i + 1]}) == data[i]) {
      money += k * data[i];
      k = 0;
    } else if (min({data[i], data[i - 1], data[i + 1]}) == data[i]) {
      int a = f(money, data[i]);
      k += a;
      money -= a * data[i];
    }
  }
  money += k * data[N - 1];
  cout << money << endl;
}
