import java.io.*;
import java.util.*;


public class TestClass {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter wr = new PrintWriter(System.out);
String A = br.readLine();
String P = br.readLine();

int out_ = count_like_dislike(A, P);
System.out.println(out_);

wr.close();
br.close();
}
static int count_like_dislike(String A, String P){
int count=0;
for(int i=0;i<A.length();i++)
{
char val1 = A.charAt(i);
char val2 = P.charAt(i);
if(val1 == val2)
{
count++;
}
}
return count;
}
}

Comments