#include <bits/stdc++.h>
using namespace std;
int a[85], n;
int cc(int i) {
  int j, k, x = 0, y = 0, n = 1000;
  for (j = i + 1; j <= n; j++) {
    if (a[j] > a[i])
      i++;
    else
      break;
  }
  for (j = i + 1; j <= n; j++) {
    if (a[j] < a[i]) {
      x = 1;
      n = min(a[j], n);
    }
    if (a[j] > n && x == 1) y = 1;
  }
  if (x == 1 && y == 1)
    return 1;
  else
    return 0;
}
int mm(int i) {
  int j, m = 0;
  for (j = i; j <= n; j++) {
    m = max(a[j], m);
  }
  return m;
}
int main() {
  int i, j, s = 1000;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i <= n; i++) {
    if (a[i + 1] < a[i] || a[i + 1] == a[i]) {
      continue;
    } else if (a[i + 1] > a[i]) {
      int p = cc(i + 1);
      if (p || i + 1 == n || i + 1 == n - 1) {
        int x = s / a[i];
        s = s - a[i] * x + a[i + 1] * x;
      } else {
        int t = mm(i);
        int x = s / a[i];
        s = s - a[i] * x + t * x;
        break;
      }
    }
  }
  printf("%d", s);
}
