#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
using P = pair<long long, long long>;
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return b;
  } else {
    return gcd(b, a % b);
  }
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long mod_pow(long long x, long long y) {
  long long tmp = x, res = 1;
  while (y) {
    if (y % 2) {
      res = res * tmp % MOD;
    }
    y >>= 1;
    tmp = tmp * tmp % MOD;
  }
  return res;
}
long long nature(long long a) {
  if (a >= 0) {
    return (a);
  } else {
    return (-1 * a);
  }
}
long long prime(long long a) {
  if (a == 2) {
    return 1;
  } else if (a % 2 == 0 || a == 1) {
    return 0;
  }
  for (long long i = 3; i * i <= a; i += 2) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}
int main() {
  int N, count = 0, money = 1000, check = 0;
  cin >> N;
  vector<long long> A(0);
  int maxA = 0;
  queue<int> b;
  queue<int> s;
  int lasta = -1;
  for (long long i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a != lasta) {
      A.push_back(a);
      maxA = max(maxA, a);
      lasta = a;
    }
  }
  for (int i = 0; i < (int)A.size(); i++) {
    if (i > 0 && i < (int)A.size() - 1) {
      if (A.at(i) > A.at(i - 1) && A.at(i) > A.at(i + 1)) {
        b.push(i);
        if (check == 0) {
          s.push(0);
        }
        check = 1;
      }
      if (A.at(i) < A.at(i - 1) && A.at(i) < A.at(i + 1)) {
        s.push(i);
        if (check == 0) {
          b.push(0);
        }
        check = 1;
      }
    }
    if (i == (int)A.size() - 1) {
      if (A.at(i) > A.at(i - 1)) {
        b.push(i);
        s.push(i - 1);
      }
    }
  }
  long long M = A.at(0);
  for (int i = 1; i < N; i++) {
  }
  while (!b.empty()) {
    long long B = b.front();
    b.pop();
    long long S, BB;
    if (!s.empty()) {
      S = s.front();
      s.pop();
      count = money / A.at(S);
      money += count * (A.at(B) - A.at(S));
      count = 0;
    } else if (!b.empty()) {
      while (!b.empty()) {
        BB = b.front();
        if (BB > B) {
          count += money / A.at(B);
          money -= count * A.at(B);
          money += count * A.at(BB);
          count = 0;
          break;
        }
      }
    }
  }
  cout << money << endl;
}
