#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using pint = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  a[n] = 0;
  pint ms(1000, 0);
  for (int i = 0; i < (n); ++i) {
    if (a[i] < a[i + 1]) {
      ll num = ms.first / a[i];
      ms.second += num;
      ms.first -= num * a[i];
    } else {
      ms.first += a[i] * ms.second;
      ms.second = 0;
    }
  }
  cout << ms.first << endl;
}
