#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int ma = 0;
int n;
void dfs(int i, int amt, int stock) {
  if (i >= n) {
    ma = max(ma, amt);
    return;
  }
  int stonks = stock;
  int mon = amt;
  if (!stock) {
    stock = (amt / v[i]);
    amt = amt - (stock * v[i]);
  } else {
    amt += (stock * v[i]);
    stock = 0;
  }
  dfs(i + 1, amt, stock);
  dfs(i + 1, mon, stonks);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  dfs(0, 1000, 0);
  dfs(0, 1000, 0);
  cout << ma << "\n";
}
