#include <bits/stdc++.h>
using namespace std;
int n;
int a[100];
int b[100];
int c[100];
long long int f(int i, int amount) {
  if (i == n) return amount;
  if (c[i]) {
    int st = amount / a[i];
    int rm = amount % a[i];
    long long int p = amount + st * c[i];
    return f(b[i], p);
  } else
    return f(i + 1, amount);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  int i;
  for (i = 0; i < n; i++) cin >> a[i];
  memset(b, -1, sizeof(b));
  b[n - 1] = n;
  memset(c, 0, sizeof(c));
  for (i = n - 2; i >= 0; i--) {
    b[i] = i + 1;
    if (a[i + 1] >= a[i]) {
      c[i] = c[i + 1] + (a[i + 1] - a[i]);
      b[i] = b[i + 1];
    }
  }
  cout << f(0, 1000) << endl;
  return 0;
}
