#include <bits/stdc++.h>
using namespace std;
long double const PI = 4 * atan((long double)1);
vector<int> vec;
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  int x;
  cin >> x;
  vec.push_back(x);
  for (int i = 1; i < n; ++i) {
    cin >> x;
    int len = vec.size();
    if (vec[len - 1] == x)
      vec.pop_back();
    else if (len >= 2 && vec[len - 2]<vec[len - 1] ^ vec[len - 1]> x)
      vec.pop_back();
    vec.push_back(x);
  }
  if (vec.size() == 1) {
    cout << 1000 << '\n';
    return 0;
  }
  int len = vec.size();
  long long money = 1000;
  for (int i = (vec[len - 1] < vec[len - 2] ? 2 : 1); i < vec.size(); i += 2) {
    long long stock = money / vec[i - 1];
    money %= vec[i - 1];
    money += stock * vec[i];
  }
  cout << money << '\n';
  return 0;
}
