#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll INF = pow(10, 9) + 7;
int main() {
  ll n, up, ans;
  cin >> n;
  vector<ll> v(100);
  vector<ll> buy;
  vector<ll> sell;
  cin >> v[0] >> v[1];
  if (v[1] > v[0]) {
    up = 1;
    buy.push_back(0);
  } else if (v[1] < v[0]) {
    up = -1;
  } else {
    up = 0;
  }
  for (int i = 0; i < n - 2; i++) {
    cin >> v[i + 2];
    if (up == 1) {
      if (v[i + 2] < v[i + 1]) {
        sell.push_back(i + 1);
        up = -1;
      }
    } else if (up == -1) {
      if (v[i + 2] > v[i + 1]) {
        buy.push_back(i + 1);
        up = 1;
      }
    }
  }
  if (up == 1) {
    sell.push_back(n - 1);
  }
  ans = 1000;
  for (int i = 0; i < (int)buy.size(); i++) {
    ans += (v[sell[i]] - v[buy[i]]) * (ans / v[buy[i]]);
  }
  cout << ans << endl;
}
