#include <bits/stdc++.h>
int main() {
  int n, money = 1000, stocks = 0;
  std::cin >> n;
  std::vector<int> day(n + 1, 0), sell(n + 1, 1);
  for (int i = 0; i < n; i++) std::cin >> day[i];
  for (int i = n - 1; i >= 0; i--) {
    if (day[i - 1] == day[i])
      sell[i - 1] = sell[i];
    else if (sell[i] && day[i - 1] < day[i])
      sell[i - 1] = 0;
    else if (!sell[i] && day[i - 1] > day[i])
      sell[i - 1] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (sell[i])
      money += day[i] * stocks, stocks = 0;
    else
      stocks += money / day[i], money %= day[i];
  }
  std::cout << money;
}
