#include <bits/stdc++.h>
using namespace std;
long long a[2000];
long long d[2000];
long long c[2000];
int main() {
  memset(c, 0x3f3f3f3f, sizeof(c));
  int n;
  cin >> n;
  int sum = 1000;
  int k = 0;
  int x = 0, y = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  a[0] = -0x3f3f3f3f;
  a[n + 1] = -0x3f3f3f3f;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= a[i + 1] && a[i] > a[i - 1]) {
      d[x++] = i;
    }
  }
  a[0] = 0x3f3f3f3f;
  a[n + 1] = 0x3f3f3f3f;
  for (int i = 1; i <= n; i++) {
    if (a[i] <= a[i + 1] && a[i] < a[i - 1]) {
      c[y++] = i;
    }
  }
  int t = 1;
  for (int i = 0, j = 0; i < y; i++) {
    for (; j < x; j++) {
      if (d[j] > c[i]) {
        k = k + sum / a[c[i]];
        sum = sum % a[c[i]];
        sum += k * a[d[j]];
        k = 0;
        break;
      }
    }
  }
  cout << sum << endl;
  return 0;
}
