#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  vector<long long> vec(n), a(n), temp;
  for (auto &i : vec) {
    cin >> i;
  }
  temp = vec;
  sort(temp.rbegin(), temp.rend());
  bool flag = false;
  for (long long i = 0; i < n; i++) {
    if (temp[i] != vec[i]) flag = true;
  }
  if (!flag) {
    cout << 1000 << '\n';
    return 0;
  }
  sort(temp.begin(), temp.end());
  for (long long i = 0; i < n; i++) {
    if (temp[i] != vec[i]) flag = true;
  }
  if (!flag) {
    long long have = 1000 % vec[0];
    long long ans = 1000 / vec[0];
    have += ans * vec[n - 1];
    cout << have << '\n';
    return 0;
  }
  long long low = 0, high = 0;
  long long have = 1000, x = 0;
  for (int i = 0; i < n - 1; i++) {
    if (i == 0 && vec[i] >= vec[i + 1])
      continue;
    else if (vec[i] < vec[i + 1]) {
      x = have / vec[i];
      have %= vec[i];
    } else if (vec[i] > vec[i + 1]) {
      have += x * vec[i];
      x = 0;
    }
  }
  if (x && vec[n - 1] > vec[n - 2]) {
    have += x * vec[n - 1];
    x = 0;
  }
  cout << have << '\n';
}
