#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  queue<pair<int, int> > que;
  pair<int, int> origin(1000, 0);
  pair<int, int> cashmax = origin;
  pair<int, int> kabumax = origin;
  for (int j = 0; j < n; j++) {
    int buykabu1 = cashmax.first / a[j];
    int kabu1 = cashmax.second + buykabu1;
    int acash1 = cashmax.first - kabu1 * a[j];
    int urine = kabumax.second * a[j];
    int acash2 = kabumax.first + urine;
    if (cashmax.first < acash2) {
      cashmax.first = acash2;
      cashmax.second = 0;
    }
    if (kabumax.second < kabu1) {
      kabumax.first = acash1;
      kabumax.second = buykabu1;
    }
  }
  cout << cashmax.first << endl;
}
