#include <bits/stdc++.h>
using namespace std;
inline int Read() {
  int ret = 0;
  char c = getchar();
  while (c > '9' || c < '0') c = getchar();
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return ret;
}
struct node {
  int wei, num;
};
const int N = 200000 + 5;
long long k;
int n;
long long ans;
node a[N];
long long contri[N];
long long shu[N];
int topn;
long long zong;
inline int lowbit(int x) { return x & -x; }
inline void add(int i, int zeng) {
  while (i <= n) {
    contri[i]++;
    shu[i] += zeng;
    i += lowbit(i);
  }
}
inline void shan(int i, int zeng) {
  while (i <= n) {
    contri[i]--;
    shu[i] -= zeng;
    i += lowbit(i);
  }
}
bool cmp(const node& i, const node& j) { return i.num < j.num; }
inline void qingkong() {
  while (a[topn].num > k && topn) {
    shan(a[topn].wei, a[topn].num);
    zong -= a[topn].num;
    topn--;
  }
}
inline long long sum(int x) {
  long long ret = 0;
  while (x) {
    ret += shu[x];
    x -= lowbit(x);
  }
  return ret;
}
inline void tiao(int to, int now) {
  long long tcon = 0, tsum = 0;
  while (to) {
    tcon += contri[to];
    tsum += shu[to];
    to -= lowbit(to);
  }
  while (now) {
    tcon -= contri[now];
    tsum -= shu[now];
    now -= lowbit(now);
  }
  ans += tcon;
  k -= tsum;
  qingkong();
}
inline int erfen(int l, int r, int now) {
  while (l < r) {
    int mid = (l + r + 1) / 2;
    if (sum(mid) - sum(now) <= k)
      l = mid;
    else
      r = mid - 1;
  }
  tiao(l, now);
  return l;
}
void work() {
  sort(a + 1, a + n + 1, cmp);
  int now = 0, l, r;
  qingkong();
  while (topn) {
    if (now == n) now = 0;
    while (zong && k >= zong) {
      long long quan = k / zong;
      ans += topn * quan;
      k %= zong;
      qingkong();
    }
    l = now + 1;
    r = n;
    now = erfen(l, r, now);
  }
}
void init() {
  scanf("%d %lld", &n, &k);
  topn = n;
  for (int i = 1; i <= n; i++) {
    a[i].num = Read();
    a[i].wei = i;
    add(i, a[i].num);
    zong += a[i].num;
  }
  work();
  printf("%lld", ans);
}
int main() {
  init();
  return 0;
}
