#include <bits/stdc++.h>
using namespace std;
vector<int> A(80);
int N, INF = 1 << 31;
int DP(int i, int stock, int money) {
  if (i == N) return money;
  int res1 = -INF, res2 = -INF;
  if (stock == 0)
    res1 = DP(i + 1, money / A[i], money - (money / A[i]) * A[i]);
  else
    res1 = DP(i + 1, 0, money + stock * A[i]);
  res2 = DP(i + 1, stock, money);
  return max(res1, res2);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> A[i];
  cout << DP(0, 0, 1000);
}
