#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int dp[n];
  for (int i = 0; i < n; i++) {
    dp[i] = 1000;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      dp[i] = max(dp[i], dp[j]);
      if (a[i] > a[j]) {
        dp[i] = max(dp[j], (dp[j] / a[j] * a[i]) + (dp[j] % a[j]));
      }
    }
  }
  int max = dp[0];
  for (int i = 1; i < n; i++) {
    if (max < dp[i]) {
      max = dp[i];
    }
  }
  cout << max << endl;
  return 0;
}
