#include <bits/stdc++.h>
int W_Length(char *str) {
  int length = 0;
  while (*str++ != '\0') length++;
  return length;
}
void swap(int *a, int *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}
double deg(double theta) { return theta * (2 * 3.14159265359) / 360; }
int cmp(const void *p, const void *q) { return *(int *)p - *(int *)q; }
int cmp_s(const void *left, const void *right) {
  char *left_char = (char *)left;
  char *right_char = (char *)right;
  return strcmp(left_char, right_char);
}
int main(void) {
  int a[250], b[250], c, n, i, buy[81] = {0}, sell[81] = {0}, mon = 1000, k = 0,
                               m = 1, kabu = 0;
  scanf("%d", &n);
  scanf("%d", &a[1]);
  b[1] = a[1];
  for (i = 2; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i - 1] == a[i]) {
      continue;
    }
    m++;
    b[m] = a[i];
  }
  if (b[1] < b[2]) {
    buy[1] = 1;
  }
  if (b[m] > b[m - 1]) {
    sell[m] = 1;
  }
  for (i = 2; i < m; i++) {
    if (b[i - 1] > b[i] && b[i + 1] > b[i]) {
      buy[i] = 1;
    }
    if (b[i - 1] < b[i] && b[i + 1] < b[i]) {
      sell[i] = 1;
    }
  }
  for (i = 1; i <= m; i++) {
    if (sell[i] == 1) {
      mon += kabu * b[i];
      kabu = 0;
    }
    if (buy[i] == 1) {
      kabu = mon / b[i];
      mon = mon % b[i];
    }
  }
  printf("%d\n", mon);
  return 0;
}
