#include <bits/stdc++.h>
using namespace std;
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename T>
string to_string(T v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) res += ", ";
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void bug() { cerr << "\n"; }
template <typename Head, typename... Tail>
void bug(Head H, Tail... T) {
  cerr << " " << to_string(H);
  bug(T...);
}
const long long M = 1000000007;
const long long N = 2e6 + 5;
const long long INF = 2e18 + 12;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long& x : v) cin >> x;
  long long money = 1000;
  for (long long i = 0; i < n - 1; i++) {
    long long stocks = money / v[i];
    money += stocks * max(v[i + 1] - v[i], 0LL);
  }
  cout << money << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  clock_t start;
  double duration;
  start = clock();
  long long tc = 1;
  for (long long t = 1; t <= tc; t++) {
    cout << "Case #" << t << ": ";
    solve();
  }
  duration = (clock() - start) / (double)CLOCKS_PER_SEC;
  cerr << "\nTotal time elapsed: " << duration << "sec\n";
}
