#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n;
int a[500500];
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  long long money = 1000, stocks = 0;
  for (int i = 1; i <= n; ++i) {
    stocks += money / a[i];
    money %= a[i];
    int j = i + 1;
    while (j <= n && a[j] >= a[j - 1]) ++j;
    --j;
    money += a[j] * stocks;
    stocks = 0;
    while (j <= n && a[j] > a[j + 1]) ++j;
    i = j - 1;
  }
  cout << money << "\n";
}
int main() {
  freopen("sample.in", "r", stdin);
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}
