#include <bits/stdc++.h>
using namespace std;
ifstream fin("cutstring.in");
ofstream fout("cutstring.out");
#define cin fin
#define cout fout
const int N = 2e3 + 10;
string s, t;
int n, m;
bool pf[N], sf[N];
int main()
{
cin >> s >> t;
int ans = 0;
for (int i = 0; i < t.length(); i++)
if (s.find(t.substr(0, i+1)) != string::npos) pf[i] = true;
for (int i = 0; i < t.length(); i++)
if (s.find(t.substr(i, t.length()-i)) != string::npos) sf[i] = true;
for (int i = 0; i < t.length()-1; i++)
ans += (pf[i] && sf[i+1]);
cout << ans;
}