#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, x, y, z, q = 1000;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  x = q / a[0];
  y = x * a[0];
  q -= y;
  for (int i = 1; i < n; i++) {
    if (q < a[i])
      break;
    else {
      z = q / a[i];
      x += z;
      y = z * a[i];
      q -= y;
    }
  }
  cout << (x * a[n - 1] + q);
  return 0;
}
