#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool isLocalMax(vector<int> &a, int i, int n) {
  int left, right;
  left = i - 1;
  right = i + 1;
  bool can1 = true;
  while (left >= 0) {
    if (a[left] > a[i]) {
      can1 = false;
      break;
    }
    if (a[left] < a[i]) {
      can1 = true;
      break;
    }
    left--;
  }
  bool can2 = true;
  while (right < n) {
    if (a[right] > a[i]) {
      can2 = false;
      break;
    }
    if (a[right] < a[i]) {
      can2 = true;
      break;
    }
    right++;
  }
  if (can1 && can2) {
    return true;
  } else {
    return false;
  }
}
bool isLocalMin(vector<int> &a, int i, int n) {
  int left, right;
  left = i - 1;
  right = i + 1;
  bool can1 = true;
  while (left >= 0) {
    if (a[left] < a[i]) {
      can1 = false;
      break;
    }
    if (a[left] > a[i]) {
      can1 = true;
      break;
    }
    left--;
  }
  bool can2 = true;
  while (right < n) {
    if (a[right] < a[i]) {
      can2 = false;
      break;
    }
    if (a[right] > a[i]) {
      can2 = true;
      break;
    }
    right++;
  }
  if (can1 && can2) {
    return true;
  } else {
    return false;
  }
}
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int money = 1000;
  int stock = 0;
  if (a[0] < a[1]) {
    stock = money / a[0];
    money -= stock * a[0];
  }
  for (int i = 1; i < n - 1; i++) {
    if (isLocalMin(a, i, n) && a[i - 1] != a[i]) {
      stock = money / a[i];
      money -= stock * a[i];
    }
    if (isLocalMax(a, i, n) && a[i - 1] != a[i]) {
      money += stock * a[i];
      stock = 0;
    }
  }
  money += stock * a[n - 1];
  cout << money << endl;
  return 0;
}
