#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 akabu1 = cashmax.second + buykabu1;
    int acash1 = cashmax.first - akabu1 * a[j];
    int akabu2 = 0;
    int acash2 = cashmax.second * a[j] + cashmax.first;
    int akabu3 = cashmax.second;
    int acash3 = cashmax.first;
    int akabu4 = 0;
    int acash4 = kabumax.first + kabumax.second * a[j];
    int bkab = kabumax.first / a[j];
    int acash5 = kabumax.first - bkab * a[j];
    int akabu5 = kabumax.second + bkab;
    int acash6 = kabumax.first;
    int akabu6 = kabumax.second;
    if (acash2 < acash4) {
      cashmax.first = acash4;
      cashmax.second = akabu4;
    } else {
      cashmax.first = acash2;
      cashmax.second = akabu2;
    }
    if (akabu1 == akabu5) {
      kabumax.first = max(acash1, acash5);
      kabumax.second = akabu1;
    } else if (akabu1 > akabu5) {
      kabumax.first = acash1;
      kabumax.second = akabu1;
    } else {
      kabumax.first = acash5;
      kabumax.second = akabu5;
    }
  }
  cout << cashmax.first << endl;
}
