#include <bits/stdc++.h>
using namespace std;
int _;
int n, money = 1000, stock = 0, a[105];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) {
    int low = n, up = n;
    bool is_low = false, is_up = false;
    for (int j = i + 1; j < n; j++)
      if (!is_low && a[j] < a[i]) {
        low = j;
        is_low = true;
      } else if (!is_up && a[j] > a[i]) {
        up = j;
        is_up = true;
      }
    if (up < low) {
      stock += money / a[i];
      money %= a[i];
      money += stock * a[up];
      stock = 0;
      i = up;
    }
  }
  printf("%d\n", money);
  return 0;
}
