#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  ;
  int n;
  int x = 1000;
  cin >> n;
  int a[n + 4];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<pair<int, int> > v;
  int k = 0;
  ;
  int z = 0;
  bool fl = true;
  for (int i = 0; i < n; i++) {
    if (a[i] > a[i + 1]) {
      fl = false;
      v.push_back({a[z], a[i]});
      z = i + 1;
      k++;
    }
  }
  if (fl == true) {
    v.push_back({a[0], a[n - 1]});
    k++;
  } else if (a[z] < a[n - 1]) {
    v.push_back({a[z], a[n - 1]});
    k++;
  }
  int y;
  for (int i = 0; i < k; i++) {
    y = x / v[i].first;
    x -= y * v[i].first;
    x += y * v[i].second;
  }
  cout << x;
}
