#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, mod = 1e9 + 7;
int m = 1000, s = 0;
void sell(int i) {
  m += (i * s);
  s = 0;
}
void buy(int i) {
  while (1) {
    if (m - i < 0) {
      break;
    } else {
      m -= i;
      ++s;
    }
  }
}
void solve() {
  int n;
  cin >> n;
  int a[n], mn = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (!i) mn = a[i];
  }
  int p = 0;
  bool v = true;
  for (int i = 1; i < n; ++i) {
    if (!v && a[i] != p) {
      mn = a[i];
      v = true;
    }
    if (v && a[i] > mn) {
      buy(mn);
      sell(a[i]);
      v = false;
      p = a[i];
    }
  }
  cout << m << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
