#include <bits/stdc++.h>
using namespace std;
int a[200005];
int b[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int cnt = 0;
  queue<int> q;
  q.push(a[0]);
  for (int i = 1; i < n - 1; i++) {
    if (a[i] > a[i - 1] && a[i] >= a[i + 1]) {
      q.push(a[i]);
      cnt++;
    }
    if (a[i] < a[i - 1] && a[i] <= a[i + 1]) {
      q.push(a[i]);
      cnt++;
    }
  }
  q.push(a[n - 1]);
  for (int i = 0; i < cnt + 2; i++) {
    b[i] = q.front();
    q.pop();
  }
  int money = 1000, piao = 0;
  for (int i = 0; i < cnt + 2; i++) {
    if (b[i] < b[i + 1]) {
      piao += money / b[i];
      money = money % b[i];
    }
    if (b[i] > b[i + 1]) {
      money += piao * b[i];
      piao = 0;
    }
  }
  cout << money << endl;
  return 0;
}
