#include<bits/stdc++.h>
#define int long long
using namespace std;
auto read = [](){
int x;
scanf("%lld", &x);
return x;
};
string s, t;
int n, m, ans;
bool check(string now){
int l = now.size();
for(int i = 0; i <= m - l; i ++){
if(s.substr(i, l) == now)
return 1;
}
return 0;
}
signed main(){
freopen("cutstring.in", "r", stdin);
freopen("cutstring.out", "w", stdout);
cin >> s;
cin >> t;
n = t.size(), m = s.size();
for(int i = 0; i < n - 1; i ++){
if(i + 1 <= m && n - i - 1 <= m){
string x = t.substr(0, i + 1), y = t.substr(i + 1);
if(check(x) && check(y))
ans ++;
}
}
printf("%lld", ans);
return 0;
}