#include <bits/stdc++.h>
using LL = long long;
using ULL = unsigned long long;
using LLL = __int128;
using ULLL = unsigned __int128;
using LD = long double;
using LLD = __float128;
namespace std {
void swap(char& x, char& y) { x ^= y, y ^= x, x ^= y; };
void swap(signed char& x, signed char& y) { x ^= y, y ^= x, x ^= y; };
void swap(unsigned char& x, unsigned char& y) { x ^= y, y ^= x, x ^= y; };
void swap(short& x, short& y) { x ^= y, y ^= x, x ^= y; };
void swap(unsigned short& x, unsigned short& y) { x ^= y, y ^= x, x ^= y; };
void swap(int& x, int& y) { x ^= y, y ^= x, x ^= y; };
void swap(unsigned int& x, unsigned int& y) { x ^= y, y ^= x, x ^= y; };
void swap(LL& x, LL& y) { x ^= y, y ^= x, x ^= y; };
void swap(ULL& x, ULL& y) { x ^= y, y ^= x, x ^= y; };
void swap(LLL& x, LLL& y) { x ^= y, y ^= x, x ^= y; };
void swap(ULLL& x, ULLL& y) { x ^= y, y ^= x, x ^= y; };
};  // namespace std
template <typename T>
struct make_unsigned : public std::make_unsigned<T> {};
template <>
struct make_unsigned<LLL> {};
using std::swap;
template <typename T, typename P>
inline constexpr auto max(const T& x, const P& y) -> decltype(x < y ? y : x) {
  return x < y ? y : x;
}
template <typename T, typename P>
inline constexpr auto min(const T& x, const P& y) -> decltype(x < y ? x : y) {
  return x < y ? x : y;
}
template <typename T, typename... Args>
inline constexpr auto max(const T& x, const Args&... args)
    -> decltype(max(x, max(args...))) {
  return max(x, max(args...));
}
template <typename T, typename... Args>
inline constexpr auto min(const T& x, const Args&... args)
    -> decltype(min(x, min(args...))) {
  return min(x, min(args...));
}
template <typename T>
inline constexpr T max(const T& x) {
  return x;
}
template <typename T>
inline constexpr T min(const T& x) {
  return x;
}
template <typename T, typename... Args>
inline void chkmax(T& d, const Args&... args) {
  d = max(d, args...);
}
template <typename T, typename... Args>
inline void chkmin(T& d, const Args&... args) {
  d = min(d, args...);
}
std::mt19937 mrand(std::random_device{}());
std::mt19937_64 mrand64(std::random_device{}());
constexpr size_t bufSize = 1 << 20;
class In {
 private:
  FILE* inFile = nullptr;
  bool status = true;
  struct stat st;
  char* ptr;
  int fd;
  size_t pos;

 public:
  inline int getch() {
    return *(ptr + pos) ? *(ptr + (pos++)) : (setStatus(false), EOF);
  }
  inline void putback(char) { pos--; }
  inline void input(FILE* f) {
    if ((inFile = f))
      fd = fileno(inFile), fstat(fd, &st),
      ptr = (char*)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0), pos = 0;
    setStatus(true);
  }
  inline void input(const char* str) {
    fd = open(str, O_RDONLY), fstat(fd, &st),
    ptr = (char*)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0), pos = 0,
    setStatus(true);
  }
  inline void setStatus(bool status) { this->status = status; }
  inline bool getStatus() const { return status; }
};
class Out {
 private:
  FILE* outFile = nullptr;
  char pbuf[bufSize], *pp;

 public:
  inline void flush() {
    (outFile ? fwrite(pbuf, 1, pp - pbuf, outFile), fflush(outFile) : 0),
        pp = pbuf;
  }
  inline void putch(const char c) {
    ((pp - pbuf == bufSize) ? fwrite(pbuf, 1, bufSize, outFile), pp = pbuf : 0),
        *pp++ = c;
  }
  inline void output(const char* str) { flush(), outFile = fopen(str, "wb"); }
  inline void output(FILE* f) { flush(), outFile = f; }
};
class IO : public In, public Out {
 private:
  long double eps = 1e-8L;
  LLL pow10 = 1000000;
  size_t precision = 6;

 public:
  IO(FILE* = nullptr, FILE* = nullptr);
  ~IO();
  inline void flush();
  inline static constexpr bool blank(char);
  template <typename T, typename... Args>
  IO& read(T&, Args&...);
  template <typename T>
  typename std::enable_if<
      (std::is_signed<T>::value && std::is_integral<T>::value) ||
          std::is_same<typename std::remove_cv<T>::ULLL, LLL>::value,
      IO&>::ULLL
  read(T&);
  template <typename T>
  typename std::enable_if<
      (std::is_unsigned<T>::value && std::is_integral<T>::value) ||
          std::is_same<typename std::remove_cv<T>::ULLL, ULLL>::value,
      IO&>::ULLL
  read(T&);
  template <typename T>
  typename std::enable_if<std::is_floating_point<T>::value, IO&>::ULLL read(T&);
  template <typename T>
  typename std::enable_if<
      std::is_integral<T>::value || std::is_floating_point<T>::value ||
          std::is_same<typename std::remove_cv<T>::ULLL, LLL>::value ||
          std::is_same<typename std::remove_cv<T>::ULLL, ULLL>::value,
      T>::ULLL
  read();
  IO& read(char&);
  IO& read(char*);
  IO& readline(char*);
  inline void setprecision(size_t = 6u);
  template <typename T, typename... Args>
  void write(const T&, const Args&...);
  inline void write() const {}
  template <typename T>
  typename std::enable_if<(std::is_signed<T>::value &&
                           std::is_integral<T>::value) ||
                              std::is_same<T, LLL>::value,
                          void>::ULLL write(T);
  template <typename T>
  typename std::enable_if<(std::is_unsigned<T>::value &&
                           std::is_integral<T>::value) ||
                              std::is_same<T, ULLL>::value,
                          void>::ULLL write(T);
  inline void write(char);
  template <typename T>
  typename std::enable_if<std::is_floating_point<T>::value, void>::ULLL write(
      T);
  inline void write(bool);
  void write(char*);
  void write(const char*);
  template <typename... Args>
  void writeln(Args...);
  template <typename Iter>
  IO& readArray(Iter, Iter);
  template <typename Iter>
  void displayArray(Iter, Iter, char = ' ');
  operator bool() const { return getStatus(); }
} io(stdin, stdout), err(nullptr, stderr);
template <typename Func>
void multipleTests(Func&&, IO& = io);
template <typename... Args>
inline void writeln(Args... x) {
  io.write(x...), io.putch('\n');
}
constexpr int maxn = 85;
int A[maxn];
int main() {
  int n;
  io.read(n).readArray(A + 1, A + n + 1);
  int a = 1000, b = 0;
  int p = 1;
  while (p + 1 <= n && A[p] >= A[p + 1]) p++;
  while (p <= n) {
    int t = a / A[p];
    b += t;
    a -= t * A[p];
    while (p + 1 <= n && A[p] <= A[p + 1]) p++;
    a += b * A[p];
    b = 0;
    if (p == n) break;
    while (p + 1 <= n && A[p] >= A[p + 1]) p++;
  }
  a += b * A[n];
  writeln(a);
  return 0;
}
IO::IO(FILE* in, FILE* out) { input(in), output(out); }
IO::~IO() { flush(); }
inline void IO::flush() { Out::flush(); }
inline constexpr bool IO::blank(char ch) {
  return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
}
template <typename T, typename... Args>
IO& IO::read(T& x, Args&... args) {
  if (read(x)) return sizeof...(args) ? read(args...) : *this;
  return *this;
}
template <typename T>
typename std::enable_if<
    (std::is_signed<T>::value && std::is_integral<T>::value) ||
        std::is_same<typename std::remove_cv<T>::ULLL, LLL>::value,
    IO&>::ULLL
IO::read(T& x) {
  static typename make_unsigned<T>::ULLL _tmp;
  bool sign = false;
  int ch = getch();
  while (!(ch >= '0' && ch <= '9') && ~ch) sign = (ch == '-'), ch = getch();
  if (!(~ch)) return setStatus(false), *this;
  _tmp = 0;
  while ((ch >= '0' && ch <= '9'))
    _tmp = (_tmp << 1) + (_tmp << 3) + (ch ^ '0'), ch = getch();
  if (~ch) putback(ch);
  x = sign ? (~_tmp + 1) : _tmp;
  return *this;
}
template <typename T>
typename std::enable_if<
    (std::is_unsigned<T>::value && std::is_integral<T>::value) ||
        std::is_same<typename std::remove_cv<T>::ULLL, ULLL>::value,
    IO&>::ULLL
IO::read(T& x) {
  int ch = getch();
  while (!(ch >= '0' && ch <= '9') && ~ch) ch = getch();
  if (!(~ch)) return setStatus(false), *this;
  x = 0;
  while ((ch >= '0' && ch <= '9'))
    x = (x << 1) + (x << 3) + (ch ^ '0'), ch = getch();
  if (~ch) putback(ch);
  return *this;
}
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value, IO&>::ULLL IO::read(
    T& x) {
  x = 0;
  T tmp = 1;
  bool sign = false;
  int ch = getch();
  while (!(ch >= '0' && ch <= '9') && ~ch) sign = (ch == '-'), ch = getch();
  if (!(~ch)) return setStatus(false), *this;
  while ((ch >= '0' && ch <= '9')) x = x * 10 + (ch ^ '0'), ch = getch();
  if (ch == '.')
    for (ch = getch(); (ch >= '0' && ch <= '9'); ch = getch())
      x += (tmp /= 10.0) * (ch ^ '0');
  if (~ch) putback(ch);
  x = sign ? (-x) : x;
  return *this;
}
template <typename T>
typename std::enable_if<
    std::is_integral<T>::value || std::is_floating_point<T>::value ||
        std::is_same<typename std::remove_cv<T>::ULLL, LLL>::value ||
        std::is_same<typename std::remove_cv<T>::ULLL, ULLL>::value,
    T>::ULLL
IO::read() {
  static typename std::remove_cv<T>::ULLL x;
  return read(x), x;
}
IO& IO::read(char& ch) {
  do ch = getch();
  while (blank(ch) && ~ch);
  if (ch == -1) setStatus(false);
  return *this;
}
IO& IO::read(char* s) {
  int ch = getch();
  while (blank(ch)) ch = getch();
  if (!(~ch)) return setStatus(false), *this;
  while (!blank(ch) && ~ch) *s++ = ch, ch = getch();
  *s = 0;
  if (~ch) putback(ch);
  return *this;
}
IO& IO::readline(char* s) {
  int ch = getch();
  while (blank(ch) && (ch ^ '\n')) ch = getch();
  if (!(~ch)) return setStatus(false), *this;
  while ((ch ^ '\n') && ~ch) *s++ = ch, ch = getch();
  *s = 0;
  return *this;
}
inline void IO::setprecision(size_t n) {
  precision = n;
  eps = powl(10.0L, -int(precision) - 2);
  pow10 = powl(10.0L, precision) + eps;
}
template <typename T, typename... Args>
void IO::write(const T& x, const Args&... args) {
  write(x);
  if (sizeof...(args)) write(args...);
}
template <typename T>
typename std::enable_if<(std::is_signed<T>::value &&
                         std::is_integral<T>::value) ||
                            std::is_same<T, LLL>::value,
                        void>::ULLL
IO::write(T x) {
  if (x < 0) x = ~x + 1, putch('-');
  static int sta[40], top = 0;
  do sta[top++] = x % 10, x /= 10;
  while (x);
  while (top) putch(sta[--top] ^ '0');
}
template <typename T>
typename std::enable_if<(std::is_unsigned<T>::value &&
                         std::is_integral<T>::value) ||
                            std::is_same<T, ULLL>::value,
                        void>::ULLL
IO::write(T x) {
  static int sta[40], top = 0;
  do sta[top++] = x % 10, x /= 10;
  while (x);
  while (top) putch(sta[--top] ^ '0');
}
inline void IO::write(bool x) { putch(x ^ 48); }
inline void IO::write(char c) { putch(c); }
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::ULLL IO::write(T x) {
  if (x == 0) {
    putch('0'), putch('.');
    for (size_t i = 1; i <= precision; i++) putch('0');
    return;
  }
  if (x < 0) putch('-'), x = -x;
  T res = (LLL)(x * pow10 + 0.5) / (pow10 * 1.0);
  LLL y = LLL(res * pow10 + eps) % pow10;
  write(LLL(res + eps));
  if (precision) {
    putch('.');
    static size_t sta[100], p = 0;
    while (p < precision && y) sta[++p] = y % 10, y /= 10;
    while (p < precision) sta[++p] = 0;
    while (p) putch(sta[p--] ^ 48);
  }
}
void IO::write(char* s) {
  while (*s) putch(*s++);
}
void IO::write(const char* s) {
  while (*s) putch(*s++);
}
template <typename... Args>
void IO::writeln(Args... x) {
  write(x...), putch('\n');
}
template <typename Iter>
IO& IO::readArray(Iter first, Iter last) {
  if (first == last) return *this;
  Iter cur = first;
  bool r = true;
  while (cur != last && r) r &= read(*cur++);
  if (!r) setStatus(false);
  return *this;
}
template <typename Iter>
void IO::displayArray(Iter first, Iter last, char delim) {
  if (first == last) return putch('\n');
  for (Iter cur = first; cur != last;) {
    write(*cur);
    if (++cur != last) putch(delim);
  }
  putch('\n');
}
template <typename Func>
void multipleTests(Func&& f, IO& _io) {
  int q;
  _io.read(q);
  for (int i = 1; i <= q; i++) f();
}
