#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int arr[n];
  for (int i = 0; i < n; i++) arr[i] = 1000;
  int init = 0;
  int MAX = 1000;
  for (int i = 0; i < n; ++i) {
    init = arr[i] / a[i];
    int rem = arr[i] % a[i];
    for (int j = i + 1; j < n; ++j) {
      arr[j] = max(arr[j], rem + (init * a[j]));
      arr[j] = max(arr[j], arr[j - 1]);
      MAX = max(MAX, arr[j]);
    }
  }
  cout << MAX << endl;
}
