#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> arr(n);
  vector<int> dp(n, 0);
  for (int i = 0; i < (int)n; i++) {
    cin >> arr[i];
  }
  int index = 0;
  while (index + 1 < n && arr[index] >= arr[index + 1]) {
    index++;
  }
  if (index >= n - 1) {
    cout << "1000\n";
    return 0;
  }
  int i = index;
  dp[index] = 0;
  dp[++index] = 1;
  index++;
  vector<pair<int, int>> pairs;
  for (; index < (int)n; index++) {
    if (arr[index] > arr[index - 1])
      dp[index] = 1;
    else
      dp[index] = 0;
  }
  for (int i = 1; i < (int)n; i++) {
    if (dp[i] == 1 && dp[i - 1] == 0) {
      pairs.push_back(make_pair(arr[i], arr[i - 1]));
    }
  }
  long long ans = 1000, cs = 0;
  for (auto itr : pairs) {
    int var = (ans / itr.second) * itr.second;
    cs += ans / itr.second;
    ans -= var;
    ans += cs * itr.first;
    cs = 0;
  }
  cout << ans;
  return 0;
}
