program main
	implicit none
    character(3)::s,t
    integer::i,ans=0
    read(*,*)s
    read(*,*)t
    do i=1,3
    	if(s(i:i)==t(i:i))then
        	ans=ans+1
        end if
    end do
    stop
end program main