#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  int yen;
  cin >> yen;
  a.push_back(yen);
  for (int i = 0; i < n - 1; i++) {
    cin >> yen;
    if (yen == a.back()) continue;
    a.push_back(yen);
  }
  int mymoney = 1000;
  int min, max;
  min = 0;
  max = 0;
  bool up, down;
  up = false, down = false;
  if (a.size() <= 1) {
    cout << 1000 << endl;
    return 0;
  } else if (a.size() == 2) {
    if (a[0] > a[1]) {
      cout << 1000 << endl;
    } else {
      int tax = 0;
      while (mymoney - a[0] >= 0) {
        tax++;
        mymoney -= a[0];
      }
      mymoney += a[1] * tax;
    }
    cout << mymoney << endl;
    return 0;
  } else {
    if (a[0] < a[1]) {
      up = true;
      min = a[0];
    } else {
      down = true;
    }
  }
  int size = a.size();
  for (int i = 1; i < size - 1; i++) {
    if (up) {
      if (a[i] < a[i + 1]) {
        if (i + 1 == size - 1) {
          max = a[i + 1];
          int tax = 0;
          while (mymoney - min >= 0) {
            tax++;
            mymoney -= min;
          }
          mymoney += tax * max;
          break;
        }
        continue;
      } else {
        max = a[i];
        int tax = 0;
        while (mymoney - min >= 0) {
          tax++;
          mymoney -= min;
        }
        mymoney += tax * max;
        min = 0;
        max = 0;
        up = false;
        down = true;
        continue;
      }
    }
    if (down) {
      if (a[i] > a[i + 1])
        continue;
      else {
        min = a[i];
        up = true;
        down = false;
        if (i + 1 == size - 1) {
          max = a[i + 1];
          int tax = 0;
          while (mymoney - min >= 0) {
            tax++;
            mymoney -= min;
          }
          mymoney += tax * max;
          break;
        }
        continue;
      }
    }
  }
  cout << mymoney << endl;
}
