#include <bits/stdc++.h>
typedef struct node {
  int data;
  struct node *next;
} Node;
Node *list[100005];
int queue[100005];
int q_head = 0, q_tail = 0;
void print_log();
void printa_int(int *a, int size);
void printl_int(int size);
int comp(const void *a, const void *b);
Node *add_node(int i, int data);
void free_list(Node *head);
int queue_empty();
int queue_full();
void enqueue(int data);
int dequeue();
long long *factorize(long long N);
void check_factorization(long long *fact);
int main() {
  int i, j, k, N;
  long long ans = 1000;
  scanf("%d", &N);
  int *A = (int *)calloc(N + 1, sizeof(int));
  long long *dp = (long long *)calloc(N + 1, sizeof(long long));
  for (i = 0; i < N; i++) scanf("%d", A + i + 1);
  dp[0] = 1000;
  for (k = 1; k <= N; k++) {
    dp[k] = 0;
    for (i = 0; i < k - 1; i++) {
      int min = 999;
      for (j = i + 1; j < k; j++) min = min > A[j] ? A[j] : min;
      int money = dp[i] % min + dp[i] / min * A[k];
      dp[k] = dp[k] < money ? money : dp[k];
    }
  }
  for (i = 0; i < N + 1; i++) ans = ans < dp[i] ? dp[i] : ans;
  printf("%lld\n", ans);
  free(A);
  return 0;
}
void print_log() { printf("=== print log ===\n"); }
void printa_int(int *a, int size) {
  int i;
  printf("[");
  for (i = 0; i < size; i++) printf("%d, ", a[i]);
  printf("]\n");
}
void printl_int(int size) {
  int i;
  Node *t;
  for (i = 0; i < size; i++) {
    printf("[%d] ", i);
    for (t = list[i]; t; t = t->next) printf("%d, ", t->data);
    printf("\n");
  }
}
int comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
Node *add_node(int i, int data) {
  if (!list[i]) {
    list[i] = (Node *)malloc(sizeof(Node *));
    list[i]->data = data;
  } else {
    Node *t;
    t = list[i];
    list[i] = (Node *)malloc(sizeof(Node *));
    list[i]->data = data;
    list[i]->next = t;
  }
  return list[i];
}
void free_list(Node *head) {
  Node *prev = NULL, *t = head;
  while (t) {
    prev = t;
    t = t->next;
    free(prev);
  }
}
int queue_empty() { return q_head == q_tail; }
int queue_full() { return (q_head - 1) % 100005 == q_tail % 100005; }
void enqueue(int data) {
  if (queue_full()) {
    printf("full!\n");
    return;
  }
  queue[q_tail++] = data;
  q_tail %= 100005;
}
int dequeue() {
  if (queue_empty()) {
    printf("empty!\n");
    return -444444;
  }
  int data = queue[q_head++];
  q_head %= 100005;
  return data;
}
long long *factorize(long long N) {
  long long *res = (long long *)calloc(((sqrt(N) + 1) * 2), sizeof(long long));
  long long i, x = N;
  int count = 0;
  for (i = 2; i * i <= N; i++) {
    long long e = 0;
    while (x % i == 0) {
      x /= i;
      e++;
    }
    if (e > 0) {
      res[count * 2] = i;
      res[count * 2 + 1] = e;
      count++;
    }
  }
  if (x > 1) {
    res[count * 2] = x;
    res[count * 2 + 1] = 1;
  }
  return res;
}
void check_factorization(long long *fact) {
  int i = 1;
  printf("%lld^%lld", fact[0], fact[1]);
  while (fact[i * 2] > 0) {
    printf(" * %lld^%lld", fact[i * 2], fact[i * 2 + 1]);
    i++;
  }
  printf("\n");
}
