#include <bits/stdc++.h>
int main(void) {
  int n;
  int a[100];
  int status[100];
  int i = 0;
  int count = 0;
  int cash = 1000;
  int stock = 0;
  int _stock = 0;
  scanf("%d", &n);
  a[0] = 0;
  a[1] = 0;
  for (i = 1; i < n + 1; i++) {
    scanf("%d", &a[i]);
    if (i > 2) {
      if (a[i - 2] >= a[i - 1] && a[i - 1] <= a[i]) {
        status[i - 1] = 1;
      } else if (a[i - 2] <= a[i - 1] && a[i - 1] >= a[i]) {
        status[i - 1] = 2;
      } else {
        status[i - 1] = 0;
      }
    }
  }
  if (n == 2) {
    if (a[1] < a[2]) {
      stock = stock + cash / a[1];
      cash = cash - stock * a[1];
      cash = stock * a[2] + cash;
    }
    printf("%d", cash);
    return 0;
  }
  for (i = 2; i < n; i++) {
    if (status[i] == 1) {
      status[1] = 0;
      break;
    } else if (status[i] == 2) {
      status[1] = 1;
      break;
    }
  }
  for (i = n - 1; i > 1; i--) {
    if (status[i] == 1) {
      status[n] = 2;
      break;
    } else if (status[i] == 2) {
      status[n] = 0;
      break;
    }
  }
  for (i = 1; i < n + 1; i++) {
    if (status[i] == 1) {
      if (cash / a[i] > 0) {
        stock = stock + cash / a[i];
        cash = cash - stock * a[i];
      }
    } else if (status[i] == 2) {
      cash = cash + stock * a[i];
      stock = 0;
    }
  }
  printf("%d", cash);
  return 0;
}
