139 B:
#include<iostream> std::string a,b;int i,j;int main(){std::cin>>a>>b;while(i<a.size()&&j<b.size()){if(a[i]==b[j])j++;i++;}std::cout<<j;}