#include <fstream>
#include <string>
#include <vector>
#define mod 666013
using namespace std;
ifstream cin ("abc2.in");
ofstream cout ("abc2.out");
vector < vector <string> > tabel_1(mod) , tabel_2(mod);
string text;
bool Found (vector < vector <string> > &tabel , string cuvant)
{
hash <string> codificare;
int lista = codificare(cuvant) % mod;
for (auto cuvant_ : tabel[lista])
if (cuvant_ == cuvant)
return true;
return false;
}
void Insert (vector < vector <string> > &tabel , string cuvant)
{
hash <string> codificare;
int lista = codificare(cuvant) % mod;
for (auto cuvant_ : tabel[lista])
if (cuvant_ == cuvant)
return;
tabel[lista].push_back(cuvant);
}
int main ()
{
string cuvant;
cin >> text >> cuvant;
for (unsigned int indice = 0 ; indice <= text.size() - cuvant.size() ; indice++)
{
string candidat = text.substr(indice , cuvant.size());
Insert(tabel_1 , candidat);
}
int pozitii = 0;
do
if (Found(tabel_1 , cuvant) == true && Found(tabel_2 , cuvant) == false)
pozitii++ , Insert(tabel_2 , cuvant);
while (cin >> cuvant);
cout << pozitii;
cout.close(); cin.close();
return 0;
}