#include<bits/stdc++.h>
using namespace std;
string s,t;
int lens,lent;
long long total;
int main(){
freopen("cutstring.in","r",stdin);
freopen("cutstring.out","w",stdout);
cin>>s>>t;
lens=s.size();lent=t.size();
for (int i=0;i<lent-1;i++){
string t1,t2;
t1.assign(t,0,i+1);
t2.assign(t,i+1,(lent-i));
if (s.find(t1)!=string::npos&&s.find(t2)!=string::npos){
total+=1;
}
}
printf("%lld",total);
return 0;
}