		IDENTIFICATION DIVISION.
        PROGRAM-ID. AtCoder.
      
        ENVIRONMENT DIVISION.
      
        DATA DIVISION.
        WORKING-STORAGE SECTION.
        01 INP PIC X(100).
      	01 INP1 PIC X(100).
        01 A PIC 9(15).
        01 B PIC 9(15).
        01 C PIC 9(15).
      	01 D PIC 9(15).
      	01 E PIC 9(15).
        01 F PIC 9(15).
      	01 ans PIC ZZZZZZZZZZZ9.
	    01 temp1 PIC 9(15).
        01 temp2 PIC 9(15).
        01 N PIC 9(15).
      
        PROCEDURE DIVISION.
      	MAIN.
			ACCEPT INP.
      		ACCEPT INP1.
      		MOVE 0 to A.
      		IF INP(1:1) = INP1(1:1) THEN
      			COMPUTE A = A + 1
      		END-IF.
      		IF INP(2:1) = INP1(2:1) THEN
      			COMPUTE A = A + 1
      		END-IF.
      		IF INP(3:1) = INP1(3:1) THEN
      			COMPUTE A = A + 1
      		END-IF.
      		MOVE A TO ans.
      		DISPLAY ans.
		STOP RUN.