#include <bits/stdc++.h>
using namespace std;
int n, *x;
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cin >> n;
  x = new int[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  int ans = 1000;
  for (int i = 0; i < n; i++) {
    int maxi = -1;
    for (int j = i + 1; j < n; j++)
      if (x[j] > x[i]) {
        maxi = j;
        break;
      }
    int mini = i;
    for (int j = i + 1; j < maxi; j++)
      if (x[j] < x[mini]) mini = j;
    if (!~maxi)
      break;
    else if (mini != i)
      i = mini;
    else {
      int buy = ans / x[i];
      ans += buy * (x[maxi] - x[i]);
    }
  }
  cout << ans;
}
