#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k = 1000, i, th = INT_MIN, tl = INT_MAX, temp = 0, cost, status = -1,
         stock = 0;
  cin >> n;
  int arr[n], diff[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  cost = arr[0];
  for (i = 1; i < n; i++) diff[i] = arr[i] - arr[i - 1];
  for (i = 1; i < n; i++) {
    temp = diff[i];
    if (temp > 0) {
      if (status == -1) {
        stock += (k / cost);
        k -= stock * cost;
      }
      status = 1;
      if (th < temp) {
        th = temp;
        cost = arr[i];
      }
    } else if (temp < 0) {
      if (status == 1) {
        k += cost * stock;
        stock = 0;
      }
      status = -1;
      if (tl > temp) {
        tl = temp;
        cost = arr[i];
      }
    }
  }
  if (status == 1) k += cost * stock;
  cout << k;
  return 0;
}
