#include<iostream>
using namespace std;
string s, t;
long long ans = 0;
int main() {
freopen("cutstring.in", "r", stdin);
freopen("cutstring.out", "w", stdout);
cin >> s >> t;
int n = s.size(), m = t.size();
for(int i = 1; i < m; i ++) {
string s1 = t.substr(0, i), s2 = t.substr(i);
if(s.find(s1) != -1 && s.find(s2) != -1) ans ++;
}
cout << ans << "\n";
return 0;
}