#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int inf = 1e9 + 7;
const double eps = 1e-6;
long long qpow(long long a, long long b, long long m) {
  long long r = 1;
  a %= m;
  for (; b; b >>= 1) {
    if (b & 1) r = r * a % m;
    a = a * a % m;
  }
  return (r + m) % m;
}
const double pi = acos(-1);
int a[100];
int v[100];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int qian = 1000, gu = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  int i = 0, flag = 0;
  while (i < n) {
    int j = i;
    while (j + 1 < n && a[j] >= a[j + 1]) j++;
    v[j] = 2;
    i = j;
    j = i;
    if (j == n - 1) break;
    while (j + 1 < n && a[j] <= a[j + 1]) j++;
    v[j] = 1;
    flag = 1;
    i = j;
    i++;
  }
  for (int i = 0; i < n; i++) {
    if (v[i] == 2 && flag) {
      gu += qian / a[i];
      qian %= a[i];
    } else if (v[i] == 1) {
      qian += gu * a[i];
      gu = 0;
    }
  }
  cout << qian << '\n';
  return 0;
}
