#include using namespace std; const int64_t inf = 1e18; /* #include // const int64_t mod = 998244353; // const int64_t mod = 1000000007; */ vector z_algorithm(string s) { vector res(int(s.size())); res[0] = (int) s.size(); int j = 0; for (int i = 1; i < (int)s.size();) { while (i + j < (int)s.size() && s[j] == s[i+j]) j++; res[i] = j; if (j == 0) {i++; continue;} int k = 1; while (i + k < (int) s.size() && k + res[k] < j) res[i+k] = res[k], k++; i += k, j -= k; } return res; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); string s, t; cin >> s >> t; vector z = z_algorithm(t + s); int n = t.size(); int cnt = 0; int ans = 0; for (int i = n; i < z.size();) { if (z[i] >= n) { ans++; i += n-1; } else { i++; } } if (t.size() == 1) ans = -1; cout << ans << endl; }