#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535897932384626;
const long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int ans = 1000, q = 0, p = -1;
  for (long long int i = 0; i < n; i++) {
    if (p != -1) {
      if (p < a[i]) {
        ans += (q * a[i]);
        q = 0;
        p = -1;
        continue;
      }
    }
    long long int f = 0, s = 0;
    for (long long int j = i + 1; j < n; j++) {
      if (a[j] > a[i]) {
        f = 1;
        s = j;
        break;
      }
    }
    if (f) {
      long long int h = 0;
      for (long long int u = i + 1; u < s; u++) {
        if (a[u] < a[i]) {
          h = 1;
          break;
        }
      }
      if (!h) {
        p = a[i];
        q += (ans / a[i]);
        ans = ans % a[i];
      }
    } else {
      if (q > 0) ans += (q * a[i]);
      p = -1;
      q = 0;
    }
  }
  cout << ans;
  return 0;
}
