#include <bits/stdc++.h>
int a[80], j;
long max;
void test(int i, long m, long k) {
  if (i == j) {
    if (m > max) max = m;
    return;
  }
  test(i + 1, m, k);
  if (i % 2 == 0) {
    k = m / a[i];
    m -= a[i] * k;
    test(i + 1, m, k);
  } else {
    m += a[i] * k;
    test(i + 1, m, 0);
  }
}
int main() {
  int i, up, n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  up = (a[0] <= a[1]);
  if (up)
    j = 1;
  else
    j = 0;
  for (i = 1; i < n; i++)
    if (up && i < n - 1 && a[i] > a[i + 1]) {
      up = 0;
      a[j++] = a[i];
    } else if (!up && i < n - 1 && a[i] < a[i + 1]) {
      up = 1;
      a[j++] = a[i];
    }
  if (up) a[j++] = a[i - 1];
  max = 1000;
  if (j > 0) test(0, 1000, 0);
  printf("%ld\n", max);
  return 0;
}
