#include <bits/stdc++.h>
using namespace std;
const long long big = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
long long max(long long x, long long y) {
  if (x > y)
    return x;
  else
    return y;
}
long long min(long long x, long long y) {
  if (x < y)
    return x;
  else
    return y;
}
long long expm(long long x, long long y) {
  if (y == 0) return 1;
  if (x == 1 || x == 0) return x;
  if (y % 2 == 1) return (expm(x, y - 1) * x) % big;
  long long t = expm(x, y / 2);
  return (t * t) % big;
}
long long exp(long long x, long long y) {
  if (y == 0) return 1;
  if (x == 1 || y == 0) return x;
  if (y % 2 == 1) return exp(x, y - 1) * x;
  long long t = exp(x, y / 2);
  return t * t;
}
long long inv(long long x) { return expm(x, big - 2); }
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  long long num = 0;
  long long mo = 1000;
  for (int i = 0; i < (int)(n); i++) {
    if (i != 0 && i + 1 != n && a[i - 1] == a[i] && a[i] == a[i + 1]) continue;
    if (i + 1 != n &&
        ((i == 0 && a[0] < a[1]) || (a[i - 1] > a[i] && a[i] <= a[i + 1]))) {
      num += mo / a[i];
      mo %= a[i];
    } else if (i != 0 && ((i + 1 == n && a[i - 1] < a[i]) ||
                          (a[i - 1] < a[i] && a[i] >= a[i + 1]))) {
      mo += num * a[i];
      num = 0;
    }
  }
  cout << mo << endl;
}
