#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N;
  tuple<int, int, int> t(1000, 1000, 0);
  for (int i = 0; i < N; i++) {
    cin >> A;
    if (get<2>(t) == 0) {
      get<2>(t) = get<1>(t) / A;
      get<1>(t) %= A;
    } else {
      if (get<0>(t) < get<1>(t) + A * get<2>(t)) {
        get<0>(t) = get<1>(t) + A * get<2>(t);
        get<1>(t) = get<0>(t);
        get<2>(t) = 0;
      }
    }
  }
  cout << get<0>(t) << endl;
  return 0;
}
