#include <bits/stdc++.h>
using namespace std;
long long int INF = 1000000007;
long long int exp(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n == 1) return x % INF;
  if (n % 2 == 0)
    return exp((x * x) % INF, n / 2);
  else
    return (x * exp((x * x) % INF, n / 2)) % INF;
}
int maxProfit(long long int price[], long long int n) {
  long long int cur = 1000;
  int profit = 1000;
  int j = 0;
  for (int i = 1; i < n; i++) {
    if (price[i - 1] > price[i]) {
      j = i;
    }
    if (price[i - 1] <= price[i] && (i + 1 == n || price[i] > price[i + 1])) {
      long long int no = profit / price[j];
      profit += ((price[i] - price[j])) * no;
    }
  }
  return profit;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, i, j;
  long long int n, k;
  cin >> n;
  long long int arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  long long int x = maxProfit(arr, n);
  cout << x << endl;
  return 0;
}
