#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
void calc_primefactorization(long long in, vector<vector<long long> >& out) {
  long long N = in, Ntmp;
  long long p, e, p_init = 2;
  vector<long long> out_tmp(2);
  if (in == 1) {
    out_tmp[0] = 1;
    out_tmp[1] = 1;
  } else {
    while (1) {
      Ntmp = N;
      p = N;
      e = 1;
      for (long long i = p_init; i * i <= N; i++) {
        if (Ntmp % i == 0) {
          e = 0;
          while (1) {
            if (Ntmp % i != 0) {
              break;
            } else {
              Ntmp = Ntmp / i;
              e++;
            }
          }
          p = i;
          break;
        }
      }
      out_tmp[0] = p;
      out_tmp[1] = e;
      out.push_back(out_tmp);
      for (int i = 0; i < e; i++) {
        N = N / p;
      }
      if (N == 1) {
        break;
      }
    }
  }
}
int bitmask(int n) {
  int a = 1;
  return (a << (n - 1));
}
int s_buy(int& money, int price) {
  int stock = 0;
  while (1) {
    if (money - price < 0) {
      break;
    }
    money = money - price;
    stock++;
  }
  return stock;
}
int main() {
  int N;
  cin >> N;
  vector<int> A(N), Signal(N - 1);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int money = 1000, stock = 0;
  for (int i = 0; i < N - 1; i++) {
    if (A[i] < A[i + 1]) {
      Signal[i] = 1;
    } else if (A[i] > A[i + 1]) {
      Signal[i] = -1;
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (Signal[i] == 1) {
      money = money + A[i] * stock;
      stock = s_buy(money, A[i]);
    } else if (Signal[i] == -1) {
      money = money + A[i] * stock;
      stock = 0;
    } else {
    }
  }
  money = money + A[N - 1] * stock;
  cout << money;
  return 0;
}
