#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<int> A = std::vector<int>(N);
  long long money = 1000;
  int kabu;
  bool isBuy = 1;
  int V = 3;
  int isMaximum;
  for (int i = 0; i < N; ++i) {
    std::cin >> A[i];
  }
  for (int i = 0; i < N; ++i) {
    if (isBuy) {
      if (i + 1 < N) {
        isMaximum = true;
        for (int j = i + 1; j <= i + V; ++j) {
          if (j >= N) break;
          if (A[i] > A[j]) {
            isMaximum = false;
          }
        }
        if (isMaximum) {
          kabu = money / A[i];
          money -= kabu * A[i];
          isBuy = 0;
        } else {
          continue;
        }
      }
    } else {
      if (i + 1 < N) {
        isMaximum = true;
        for (int j = i + 1; j <= i + V; ++j) {
          if (j >= N) break;
          if (A[i] < A[j]) {
            isMaximum = false;
          }
        }
        if (isMaximum) {
          money += kabu * A[i];
          kabu = 0;
          isBuy = 1;
        } else {
          continue;
        }
      } else {
        money += kabu * A[i];
        kabu = 0;
      }
    }
  }
  std::cout << money;
}
