#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];
  }
  vector<pair<int, int>> pairs;
  int var = 0, cmax = 0;
  for (int index = 1; index < (int)n; index++) {
    if (arr[index] > arr[index - 1]) {
      dp[index] = 1;
      var = 1;
    } else if (arr[index] == arr[index - 1]) {
      dp[index] = var;
    } else {
      dp[index] = 0;
      var = 0;
    }
    cmax = max(cmax, dp[index]);
  }
  if (cmax == 0) {
    cout << "1000\n";
    return 0;
  }
  for (int i = 0; i < (int)n; i++) {
    if (dp[i] == 0) {
      int j = i + 1;
      while (j < n && dp[j] == 0) {
        j++;
      }
      while (j < n && dp[j] == 1) {
        j++;
      }
      j--;
      if (arr[j] > arr[i]) pairs.push_back(make_pair(arr[j], arr[i]));
      i = j;
    }
  }
  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;
}
