#include <bits/stdc++.h>
typedef struct asset {
  long long int bil;
  long long int stk;
} t_asset;
int willup(int a[82], int n, int i) {
  int j;
  int ret;
  int tmp;
  ret = i;
  tmp = a[i];
  for (j = i; j < n - 1; j++) {
    if (a[i] < a[j] && a[j] > a[j + 1]) {
      tmp = a[j];
      ret = j;
      return ret;
    }
  }
  if (tmp < a[n - 1]) {
    ret = n - 1;
  }
  return ret;
}
int willdown(int a[82], int n, int i) {
  int j;
  int ret;
  int tmp;
  ret = i;
  tmp = a[i];
  for (j = i; j < n - 1; j++) {
    if (a[i] > a[j] && a[j] < a[j + 1]) {
      tmp = a[j];
      ret = j;
      return ret;
    }
  }
  if (tmp > a[n - 1]) {
    ret = n - 1;
  }
  return ret;
}
t_asset buy(t_asset tmp, long long int price) {
  long long int k;
  k = tmp.bil / price;
  tmp.stk += k;
  tmp.bil -= k * price;
  return tmp;
}
t_asset sell(t_asset tmp, long long int price) {
  long long int k;
  k = tmp.stk * price;
  tmp.stk = 0;
  tmp.bil += k;
  return tmp;
}
int main(void) {
  int n;
  int a[82];
  int i;
  int next;
  t_asset tmp;
  scanf("%d\n", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  tmp.bil = 1000LL;
  tmp.stk = 0LL;
  for (i = 0; i < n; i++) {
    if ((next = willup(a, n, i)) != i) {
      tmp = buy(tmp, (long long int)a[i]);
      tmp = sell(tmp, (long long int)a[next]);
      i = next;
    }
    if ((next = willdown(a, n, i)) != i) {
      tmp = sell(tmp, (long long int)a[i]);
      tmp = buy(tmp, (long long int)a[next]);
      i = next;
    }
  }
  tmp = sell(tmp, (long long int)a[n - 1]);
  printf("%lld", tmp.bil);
  return (0);
}
