program ideone;
var slogan, inp : string;
count, position, len : integer;
function isEqual( {inp,} position, {slogan,} len :integer ):boolean;
begin
{writeln('Comparing inp[',position,']=',copy(inp,position,len),
' and slogan[',len,']=',copy(slogan,length(slogan)-len+1,length(slogan)) );}
while (len>0) and (inp[position+len-1] = slogan[len]) do begin
{writeln(' ',inp[position+len-1],'=',slogan[len] );}
dec(len);
end;
isEqual := (len=0);
end;
begin
{ввести змінні}
readln(slogan);
readln(inp);
count := 0;
position := 1;
{поки не скінчився вхідний рядок, шукати в ньому максимальний шмат слогана}
while position < length(inp) do begin
len := length(slogan);
{гарантовано, що знайдеться}
while not isEqual( {inp,} position, {slogan,} len ) do
dec(len);
inc(count);
inc(position, len);
end;
{вивести результат}
writeln(count);
end.
cHJvZ3JhbSBpZGVvbmU7Cgp2YXIgc2xvZ2FuLCBpbnAgOiBzdHJpbmc7Cgljb3VudCwgcG9zaXRpb24sIGxlbiA6IGludGVnZXI7CgpmdW5jdGlvbiBpc0VxdWFsKCB7aW5wLH0gcG9zaXRpb24sIHtzbG9nYW4sfSBsZW4gOmludGVnZXIgKTpib29sZWFuOwpiZWdpbgoJe3dyaXRlbG4oJ0NvbXBhcmluZyBpbnBbJyxwb3NpdGlvbiwnXT0nLGNvcHkoaW5wLHBvc2l0aW9uLGxlbiksCgkJCScgYW5kIHNsb2dhblsnLGxlbiwnXT0nLGNvcHkoc2xvZ2FuLGxlbmd0aChzbG9nYW4pLWxlbisxLGxlbmd0aChzbG9nYW4pKSApO30KCXdoaWxlIChsZW4+MCkgYW5kIChpbnBbcG9zaXRpb24rbGVuLTFdID0gc2xvZ2FuW2xlbl0pIGRvIGJlZ2luCgkgIHt3cml0ZWxuKCcJJyxpbnBbcG9zaXRpb24rbGVuLTFdLCc9JyxzbG9nYW5bbGVuXSApO30KCSAgZGVjKGxlbik7CgllbmQ7Cglpc0VxdWFsIDo9IChsZW49MCk7CmVuZDsKCmJlZ2luCgl70LLQstC10YHRgtC4INC30LzRltC90L3Rln0KCXJ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