#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class T>
using V = vector<T>;
template <typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
long long int pom(long long int a, long long int n, int m) {
  long long int x = 1;
  for (a %= m; n; n /= 2) n& 1 ? x = x * a % m : 0, a = a * a % m;
  return x;
}
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int ddx[8] = {-1, 0, 1, 0, 1, 1, -1, -1};
int ddy[8] = {0, -1, 0, 1, 1, -1, 1, -1};
long long int cmp1(pair<pair<long long int, long long int>, long long int> a,
                   pair<pair<long long int, long long int>, long long int> b) {
  return a.first.second > b.first.second;
}
long long int cmp2(pair<pair<long long int, long long int>, long long int> a,
                   pair<pair<long long int, long long int>, long long int> b) {
  return a.second < b.second;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int n;
  cin >> n;
  V<long long int> a(n);
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int ans = 0;
  long long int kabu = 0;
  long long int money = 1000;
  if (a[1] > a[0]) {
    kabu += money / a[0];
    money %= a[0];
  }
  for (long long int i = 1; i < n - 1; i++) {
    int j = i - 1, k = i + 1;
    int A = -1, B = -1;
    while (a[i] == a[j] && j > 0) {
      j--;
    }
    if (a[i] > a[j])
      A = 1;
    else if (a[i] < a[j])
      A = 2;
    while (a[i] == a[k] && k < n - 1) {
      k++;
    }
    if (a[i] > a[k])
      B = 1;
    else if (a[i] < a[k])
      B = 2;
    if (A == 1 && B == 1) {
      money += kabu * a[i];
      kabu = 0;
    } else if (A == 2 && B == 2) {
      kabu += money / a[i];
      money %= a[i];
    }
  }
  if (kabu) {
    money += kabu * a[n - 1];
  }
  ans = money;
  cout << ans << endl;
  return 0;
}
