#include <bits/stdc++.h>
using namespace std;
long long int money = 1000, n, gp, p;
int main() {
  cin >> n;
  long long int cost[n + 1];
  for (p = 1; p <= n; p++) {
    if (cost[p + 1] > cost[p]) {
      gp += (money / cost[p]);
      money -= (cost[p] * gp);
    }
    if (cost[p + 1] < cost[p]) {
      money += (cost[p] * gp);
      gp = 0;
      gp += (money / cost[p + 1]);
      money -= (cost[p + 1] * gp);
    }
  }
  cout << money << endl;
  return 0;
}
