#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  int today = 0;
  int left = 0;
  int right = 0;
  int ans = 1000;
  while (today < n) {
    bool exist = false;
    left = -1;
    right = -1;
    for (int i = today; i < n; i++) {
      if (A[i] > A[today]) {
        right = i;
        break;
      }
    }
    for (int i = today; i < n; i++) {
      if (A[i] < A[today]) {
        left = i;
        break;
      }
    }
    if (left != -1 && right != -1 && left < right) {
      today = left;
    }
    if (right > today) {
      int count = ans / A[today];
      ans = ans - (count * A[today]);
      ans = ans + (count * A[right]);
      today = right;
      exist = true;
    }
    if (exist == true) {
    } else {
      today++;
    }
  }
  cout << ans << endl;
  return 0;
}
