#include <bits/stdc++.h>
using namespace std;
int dp[100];
signed main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < (n); i++) cin >> a[i];
  long long cash = 1000;
  bool mono_increase = true;
  bool mono_decrease = true;
  for (int i = 0; i < (n - 1); i++) {
    if (a[i] < a[i + 1]) mono_decrease = false;
    if (a[i] > a[i + 1]) mono_increase = false;
  }
  if (mono_decrease) {
    cout << cash << endl;
    return 0;
  } else if (mono_increase) {
    cout << (1000 / a[0]) * a[n - 1] + 1000 % a[0] << endl;
    return 0;
  }
  int index = 0, search_index;
  for (int i = 0; i < (n - 1); i++) {
    if (a[i] < a[i + 1]) {
      index = i;
      break;
    }
  }
  while (index < n) {
    search_index = index;
    while (true) {
      if (search_index >= n) break;
      if (a[search_index] > a[search_index + 1]) break;
      search_index++;
    }
    cash += (a[search_index] - a[index]) * (cash / a[index]);
    index = search_index + 1;
  }
  cout << cash << endl;
  return 0;
}
