#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int i, j, k, n, s = 0;
  cin >> n;
  vector<int> a, b(n);
  for (i = 0; i < (n); ++i) {
    cin >> b[i];
  }
  k = 1000, s = 0;
  i = 0;
  while (i < n - 1) {
    while ((i < n - 1) && (b[i + 1] <= b[i])) i++;
    if (i == n - 1) break;
    s += k / b[i];
    k = k % b[i];
    i++;
    while ((i < n) && (b[i] >= b[i - 1])) i++;
    k += s * b[i - 1];
    s = 0;
  }
  cout << k << endl;
  return 0;
}
