#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int& x : a) cin >> x;
  a.push_back(-1);
  int ans = 1000;
  int pre = INF;
  for (int i = 0; i < n; ++i) {
    if (a[i] < a[i + 1]) {
      pre = min(pre, a[i]);
    } else {
      int rem = ans % pre;
      int num = ans / pre;
      ans = rem + num * a[i];
      pre = a[i + 1];
    }
  }
  cout << ans;
  return 0;
}
