#include<iostream>
using namespace std;
int main()
{
	char cha1[11],cha2[11];
	 cout<<"put first"<<endl;
	 cin>>cha1;
	 cout<<"put second"<<endl;
	 cin>>cha2;
	 int k=0;
	 char* point_char1=cha1;
	 char* point_char2=cha2;
	 for(int i=0;i!=10;i++)
	 {
		 if(*point_char1==*point_char2)
		 {
			 k++;
		 }
		 point_char1++;
		 point_char2++;
	 }
	 cout<<k<<endl;
	return 0;
}