#include <bits/stdc++.h>
using namespace std;
int main() {
  int num[80];
  int n, r = 0, count = 0, ans = 1000;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> num[i];
  for (int i = 0; i < n - 1; i++) {
    if (num[i] == num[i + 1] || (num[i] > num[i + 1] && count == 0))
      continue;
    else if (num[i] > num[i + 1] && count > 0) {
      ans = num[i] * count + r;
      count = 0;
    } else if (num[i] < num[i + 1] && count == 0) {
      count = ans / num[i];
      r = ans % num[i];
      ans = r;
    } else if (num[i] < num[i + 1] && count > 0)
      continue;
  }
  if (count != 0) ans = count * num[n - 1] + r;
  cout << ans << endl;
  return 0;
}
