#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 7;
const double EPS = 1e-8;
long long n;
struct Tree {
  vector<long long> t;
  Tree(int n) : t(8 * n, 0) {}
  void change(int v, long long x, int lt = 0, int rt = n, int vt = 1) {
    if (lt > v || rt <= v) return;
    if (rt - lt == 1) {
      t[vt] = x;
      return;
    }
    long long mt = (lt + rt) / 2;
    change(v, x, lt, mt, 2 * vt);
    change(v, x, mt, rt, 2 * vt + 1);
    t[vt] = t[2 * vt] + t[2 * vt + 1];
  }
  long long get(int l, int r, int lt = 0, int rt = n, int vt = 1) {
    if (l >= rt || lt >= r) {
      return 0;
    }
    if (l <= lt && rt <= r) {
      return t[vt];
    }
    int mt = (lt + rt) / 2;
    return get(l, r, lt, mt, 2 * vt) + get(l, r, mt, rt, 2 * vt + 1);
  }
  long long force(long long sum, int lt = 0, int rt = n, int vt = 1) {
    int mt = (lt + rt) / 2;
    if (rt - lt == 1) {
      return lt;
    }
    if (t[2 * vt] > sum) {
      return force(sum, lt, mt, 2 * vt);
    }
    sum -= t[2 * vt];
    return force(sum, mt, rt, 2 * vt + 1);
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long all;
  cin >> n >> all;
  Tree t(n), ex(n);
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    t.change(i, a[i]);
    ex.change(i, 1);
  }
  long long pos = 0;
  long long cnt = n;
  long long res = 0;
  while (cnt) {
    long long sum = t.get(0, n);
    res += cnt * (all / sum);
    all = all % sum;
    long long pref = t.get(pos, n);
    if (pref > all) {
      all += t.get(0, pos);
      res -= ex.get(0, pos);
    } else {
      all -= pref;
      res += ex.get(pos, n);
    }
    long long now = t.force(all);
    all -= t.get(0, now);
    res += ex.get(0, now);
    t.change(now, 0);
    ex.change(now, 0);
    pos = now;
    cnt--;
  }
  cout << res;
}
