#include <bits/stdc++.h>
using namespace std;
int mx8[] = {0, 0, 1, -1, -1, 1, -1, 1};
int my8[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int mx4[] = {1, -1, 0, 0};
int my4[] = {0, 0, -1, 1};
const int MOD = 1000000007;
long long int y[10000005];
int main() {
  int n;
  cin >> n;
  vector<int> a(n), kai, uri;
  for (int i = 0; i < (n); i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] < a[j]) {
        kai.push_back(a[i]);
        uri.push_back(a[j]);
        int k = j + 1;
        while (a[j] <= a[k]) k++;
        i = k;
        break;
      }
    }
  }
  int N = uri.size(), money = 1000, kabu = 0;
  for (int i = 0; i < (N); i++) {
    kabu += money / kai[i];
    money %= kai[i];
    money += uri[i] * kabu;
    kabu = 0;
  }
  cout << money << endl;
}
