#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 7;
int n, a[maxn], dp[100][maxn][20], ans;
int f(int ans, int x, int y) {
  int s = ans / x;
  return ans - s * x + s * y;
}
int main() {
  scanf("%d", &n);
  ans = 1000;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int mi = a[1];
  for (int i = 2; i <= n; i++) {
    if (a[i] > mi) {
      ans = f(ans, mi, a[i]);
      mi = a[i];
    } else
      mi = a[i];
  }
  printf("%d\n", ans);
}
