#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<long long> v;
  long long i, j, n, x, cur = 1000, cnt = 0, a[85];
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  v.emplace_back(a[1]);
  for (i = 2; i <= n; i++) {
    if (a[i] == v.back())
      continue;
    else if (a[i] > v.back())
      v.emplace_back(a[i]);
    else {
      if (((int)v.size()) & 1) {
        if (v.size() > 1) {
          x = v.back();
          v.pop_back();
          v.pop_back();
          v.emplace_back(x);
        }
      }
      if (v.size() > 1) {
        for (j = 1; j < (int)v.size(); j += 2) {
          cnt = cur / v[j - 1];
          cur %= v[j - 1];
          cur += cnt * v[j];
        }
      }
      v.clear();
      v.emplace_back(a[i]);
    }
  }
  if (((int)v.size()) & 1) {
    if (v.size() > 1) {
      x = v.back();
      v.pop_back();
      v.pop_back();
      v.emplace_back(x);
    }
  }
  if (v.size() > 1) {
    for (j = 1; j < (int)v.size(); j += 2) {
      cnt = cur / v[j - 1];
      cur %= v[j - 1];
      cur += cnt * v[j];
    }
  }
  cout << cur;
  return 0;
}
