#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
signed main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  int money = 1000, count = 0;
  for (int i = 0; i < N; i++) {
    if (i != 0 && A[i] > A[i - 1]) {
      bool found = false;
      int temp = A[i];
      for (int j = i + 1; j < N; j++) {
        if (A[i] < A[j]) {
          found = true;
        }
        if (temp > A[j]) {
          found = false;
          break;
        }
        temp = max(temp, A[j]);
      }
      if (!found) {
        money += count * A[i];
        count = 0;
      }
    } else if (A[i + 1] > A[i]) {
      int buy_count = money / A[i];
      money = money - buy_count * A[i];
      count += buy_count;
    }
  }
  cout << money << endl;
  return 0;
}
