#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, unsigned int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = res * x % 1000000007ll;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
void solve() {
  int n;
  cin >> n;
  vector<int> ar(n + 2);
  ar[0] = 1000000;
  ar[n + 1] = -1000;
  for (int i = 1; i < n + 1; i++) cin >> ar[i];
  long long int ans = 1000;
  int stocks = 0;
  for (int i = 1; i < n + 1; i++) {
    if (stocks == 0 && ar[i - 1] >= ar[i] && ar[i] <= ar[i + 1]) {
      int number = ans / ar[i];
      stocks += number;
      ans -= number * (ar[i]);
    } else if (ar[i - 1] > ar[i] && ar[i] < ar[i + 1]) {
      int number = ans / ar[i];
      stocks += number;
      ans -= number * (ar[i]);
    } else if (ar[i - 1] <= ar[i] && ar[i] >= ar[i + 1]) {
      ans += stocks * (ar[i]);
      stocks = 0;
    }
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) solve();
}
