#include <bits/stdc++.h>
using namespace std;
int arr[85], n;
int greedy(int x) {
  int cur = 1000 % arr[x];
  int stock = 1000 / arr[x], res = 1000;
  for (int i = x + 1; i < n; ++i) {
    if (arr[i] > arr[i - 1]) {
      cur += stock * arr[i];
      stock = 0;
      res = max(res, cur);
    } else if (arr[i] < arr[i - 1]) {
      stock += cur / arr[i];
      cur %= arr[i];
    }
  }
  return res;
}
void m1() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  int res = 1000;
  for (int i = 0; i < n - 1; ++i) {
    res = max(greedy(i), res);
  }
  cout << res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  m1();
}
