#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = int(0); i < int(n); i++) cin >> a.at(i);
  vector<P> lowHigh;
  int low = INT_MAX;
  int high = INT_MIN;
  int lowIndex = -1;
  int highIndex = -1;
  for (int i = int(0); i < int(n); i++) {
    int x = a.at(i);
    if (low == INT_MAX && high == INT_MIN) {
      low = x;
      lowIndex = i;
      high = x;
      highIndex = i;
      continue;
    }
    int y = a.at(i - 1);
    if (x < y) {
      if (low != high && highIndex > lowIndex) {
        lowHigh.emplace_back(lowIndex, highIndex);
        low = INT_MAX;
        high = INT_MIN;
      }
    } else {
      if (x < low) {
        low = x;
        lowIndex = i;
      } else if (x > high) {
        high = x;
        highIndex = i;
      }
      if (i == n - 1 && high != low) {
        lowHigh.emplace_back(lowIndex, highIndex);
        break;
      }
    }
    if (x < low) {
      low = x;
      lowIndex = i;
    } else if (x > high) {
      high = x;
      highIndex = i;
    }
  }
  ll res = 1000;
  for (auto lh : lowHigh) {
    ll buyCount = res / a.at(lh.first);
    res -= buyCount * a.at(lh.first);
    res += a.at(lh.second) * buyCount;
  }
  cout << res << endl;
  return 0;
}
