#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1LL << 60;
const int INF = 1001001001;
int n;
int money, stock;
int ans;
vector<int> a;
void dfs(vector<int> &A, int m, int s, int day) {
  if (day == n) {
    money = max(money, m);
    return;
  }
  dfs(a, m, s, day + 1);
  for (int i = 0; i < (2); i++) {
    if (i % 2 == 0) {
      int buy = m / A[day];
      m -= buy * A[day];
      s += buy;
      dfs(a, m, s, day + 1);
    } else {
      m += s * A[day];
      s = 0;
      dfs(a, m, s, day + 1);
    }
  }
}
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  money = 1000;
  stock = 0;
  dfs(a, 1000, 0, 0);
  cout << money << endl;
  return 0;
}
