#include <bits/stdc++.h>
using namespace std;
int n;
long long int A[80];
long long int ans = 0;
void dfs(int i, long long int mon, int kabu) {
  if (i == n) {
    ans = max(ans, mon);
  } else {
    dfs(i + 1, mon, kabu);
    dfs(i + 1, mon - (mon / A[i]) * A[i], kabu + (mon / A[i]));
    dfs(i + 1, mon + (kabu * A[i]), 0);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  dfs(0, 1000, 0);
  cout << ans << endl;
}
