#include <bits/stdc++.h>
using namespace std;
int n;
long long T;
long long cost[400010];
struct Data {
  long long tot, cnt;
  Data operator+(Data b) { return (Data){tot + b.tot, cnt + b.cnt}; }
} sum[400010];
int lowbit(int x) { return x & (-x); }
void add(int x, Data w) {
  while (x <= 2 * n) {
    sum[x] = sum[x] + w;
    x += lowbit(x);
  }
}
long long query_sum(int x) {
  long long ret = 0;
  while (x) {
    ret += sum[x].tot;
    x -= lowbit(x);
  }
  return ret;
}
long long query_cnt(int x) {
  long long ret = 0;
  while (x) {
    ret += sum[x].cnt;
    x -= lowbit(x);
  }
  return ret;
}
struct Node {
  long long co;
  int pos;
};
Node q[400010];
int tail;
int Get_pos(long long x, int now_pos) {
  int l = now_pos, r = now_pos + n - 1, mid, ans = 0;
  while (l <= r) {
    mid = l + r >> 1;
    long long qq = query_sum(mid) - query_sum(now_pos - 1);
    if (qq <= x)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return (ans > n ? ans - n : ans);
}
bool cmp(Node &a, Node &b) { return a.co < b.co; }
int main() {
  scanf("%d %lld", &n, &T);
  tail = n;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &cost[i]);
    q[i].co = cost[i];
    q[i].pos = i;
  }
  sort(q + 1, q + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    add(i, (Data){cost[i], 1});
    add(i + n, (Data){cost[i], 1});
  }
  long long ans = 0, now_pos = 1;
  int tot_n = n;
  while (tot_n) {
    long long sum_cir = query_sum(n);
    ans += T / sum_cir * query_cnt(n);
    T %= sum_cir;
    int pos = Get_pos(T, now_pos);
    if (pos) {
      T -= query_sum(pos >= now_pos ? pos : pos + n) - query_sum(now_pos - 1);
      ans += query_cnt(pos >= now_pos ? pos : pos + n) - query_cnt(now_pos - 1);
    } else
      pos = now_pos == 1 ? n : now_pos - 1;
    while (tail && q[tail].co > T) {
      add(q[tail].pos, (Data){-q[tail].co, -1});
      add(q[tail].pos + n, (Data){-q[tail].co, -1});
      tot_n--;
      tail--;
    }
    now_pos = (pos == n - 1 ? 1 : pos + 1);
  }
  printf("%lld\n", ans);
}
