#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1000000007;
const long long INF = 999999999999999999;
const long long NN = (long long)(1e6 + 5);
long long min(long long x, long long y) {
  if (x < y) return x;
  return y;
}
long long max(long long x, long long y) {
  if (x > y) return x;
  return y;
}
long long power(long long x, unsigned long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
long long hcf(long long a, long long b) {
  if (b == 0) return a;
  return hcf(b, a % b);
}
long long n;
vector<long long> v;
map<pair<long long, pair<long long, long long>>, long long> dp;
long long func(long long ind, long long money, long long stock) {
  if (ind == n - 1) return money + stock * v[ind];
  if (dp[{ind, {money, stock}}]) return dp[{ind, {money, stock}}];
  return dp[{ind, {money, stock}}] =
             max(func(ind + 1, money - ((money / v[ind]) * v[ind]),
                      stock + (money / v[ind])),
                 func(ind + 1, (money + stock * v[ind]), 0));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long TT = 1;
  while (TT--) {
    cin >> n;
    v.resize(n);
    for (auto &u : v) cin >> u;
    long long ans = func(0, 1000, 0);
    cout << ans;
  }
}
