#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  vector<int> pm(N);
  pm.at(0) = -100;
  for (int i = 1; i < N; i++) pm.at(i) = A.at(i) - A.at(i - 1);
  int money = 1000, money_old = 0, kabu = 0, min_v = 201, max_v = 99;
  int i = 0;
  while (true) {
    if (pm.at(i) < 0) {
      while (true) {
        if (pm.at(i) <= 0) {
          min_v = A.at(i);
          i++;
          if (i > N - 1)
            break;
          else
            continue;
        } else {
          money_old = money;
          kabu = money / min_v;
          money -= min_v * kabu;
          break;
        }
      }
    } else if (pm.at(i) > 0) {
      while (true) {
        if (pm.at(i) >= 0) {
          max_v = A.at(i);
          i++;
          if (i > N - 1) {
            money += max_v * kabu;
            kabu = 0;
            break;
          } else
            continue;
        } else {
          money += max_v * kabu;
          kabu = 0;
          break;
        }
      }
    } else
      i++;
    if (i > N - 1) {
      if (kabu > 0) money += A.at(N - 1) * kabu;
      break;
    } else
      continue;
  }
  cout << money << endl;
  return 0;
}
