#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
int n = s.length();
int m = t.length();
if(m>n){
cout<<"0\n";
exit(0);
}
//sliding window from line 16 - 34
string temp = "";
vector<int>start_index;
for(int i=0;i<m;++i){
temp+=s[i];
}
if(temp == t){
start_index.push_back(0);
}
for(int i=m;i<n;++i){
temp.erase(temp.begin());
temp+=s[i];
if(temp == t){
start_index.push_back((i+1)-m);
}
}
int c=0;
int sz = start_index.size();
c = min(1,sz);
for(int i=1;i<sz;++i){
if(start_index[i]-start_index[i-1]>=m){
c++;
}
}
//all equal substring are overlapping ones
// so size of start_index is equal to overlappinng substrings
// c is the non overlapping substring equal to 't'
cout<<" Overlapping substrings equal to 't' "<<sz<<endl;
cout<<" Non overlpaping substring equal to 't' "<<c<<endl;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7CglzdHJpbmcgcyx0OwoJY2luPj5zPj50OwoJCglpbnQgbiA9IHMubGVuZ3RoKCk7CglpbnQgbSA9IHQubGVuZ3RoKCk7CgkKCWlmKG0+bil7CgkJY291dDw8IjBcbiI7CgkJZXhpdCgwKTsKCX0KCQoJLy9zbGlkaW5nIHdpbmRvdyBmcm9tIGxpbmUgMTYgLSAzNAoJc3RyaW5nIHRlbXAgPSAiIjsKCXZlY3RvcjxpbnQ+c3RhcnRfaW5kZXg7Cglmb3IoaW50IGk9MDtpPG07KytpKXsKCQl0ZW1wKz1zW2ldOwoJfQoJCglpZih0ZW1wID09IHQpewoJCXN0YXJ0X2luZGV4LnB1c2hfYmFjaygwKTsKCX0KCQoJZm9yKGludCBpPW07aTxuOysraSl7CgkJdGVtcC5lcmFzZSh0ZW1wLmJlZ2luKCkpOwoJCXRlbXArPXNbaV07CgkJCgkJaWYodGVtcCA9PSB0KXsKCQkJc3RhcnRfaW5kZXgucHVzaF9iYWNrKChpKzEpLW0pOwoJCX0KCX0KCQoJaW50IGM9MD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