#include <bits/stdc++.h>
using namespace std;
vector<int> vi;
vector<int> temp, res;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int s;
    scanf("%d", &s);
    vi.push_back(s);
  }
  int ori = 1000, cnt = 0;
  for (int i = 1; i < n - 1; i++) {
    if (vi[i] > vi[i - 1] && vi[i] >= vi[i + 1]) {
      temp.push_back(vi[i]);
    }
    if (vi[i] < vi[i - 1] && vi[i] <= vi[i + 1]) {
      temp.push_back(vi[i]);
    }
  }
  if (temp.size() == 0) {
    res.push_back(vi[0]);
    res.push_back(vi[n - 1]);
  } else {
    if (vi[0] < temp[0]) {
      res.push_back(vi[0]);
      for (int i = 0; i < temp.size(); i++) {
        res.push_back(temp[i]);
      }
      temp = res;
      res.clear();
    }
    if (vi[n - 1] > temp[temp.size() - 1]) {
      temp.push_back(vi[n - 1]);
    }
    res = temp;
  }
  for (int i = 0; i < res.size(); i++) {
    if (res[i] < res[i + 1]) {
      cnt = ori / res[i];
      ori -= cnt * res[i];
    } else {
      ori += cnt * res[i];
      cnt = 0;
    }
  }
  printf("%d", ori);
  return 0;
}
