#include <iostream>
#include <cstring>

using namespace std;

int main()
{

string t, s;
int x, y, brojac0 = 0;
x = 0;
cin >> t >> s;
while(x <= t.length()) {
y = t.find (s[0], x);
brojac0 += 1;
if (y == 0) {
    y += 1;}
x += y;
}
cout << brojac0 << endl;
}