#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long a[200005];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m, sum, ans = 0, t;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  while (1) {
    sum = t = 0;
    for (long long i = 1; i <= n; i++)
      if (m >= a[i]) {
        sum += a[i];
        t++;
        ans++;
        m -= a[i];
      }
    if (!t) break;
    ans = ans + m / sum * t;
    m = m % sum;
  }
  cout << ans;
  return 0;
}
