#include using namespace std; typedef long long ll; typedef pair l_l; typedef pair i_i; template inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } const long double EPS = 1e-10; const long long INF = 1e18; const long double PI = acos(-1.0L); //const ll mod = 1000000007; int main() { //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); string S, T; cin >> S >> T; int ans = 0; for(int i = 0; i < S.size(); i++) { if(!(S.substr(i, (int)T.size()) == T)) { continue; } if(T.size() == 1) { cout << -1 << endl; return 0; } ans++; i += T.size() - 2; } cout << ans << endl; return 0; }