S=list(eval(input()))

T=list(eval(input()))

cnt = 0

for i in range(3):

    if S[i] == T[i]:

        cnt += 1

print(cnt)
import sys

input = sys.stdin.readline



s = input().rstrip()

t = input().rstrip()



cnt = 0



for i in range(3):

    if s[i] == t[i]:

        cnt += 1



print(cnt)



    
S = list(eval(input()))
T = list(eval(input()))
cnt = 0
for i in range(3):
    if S[i] == T[i]:
        cnt += 1
print(cnt)

import sys

input = sys.stdin.readline
s = input().rstrip()
t = input().rstrip()
cnt = 0
for i in range(3):
    if s[i] == t[i]:
        cnt += 1
print(cnt)

-S = list(eval(input())) -T = list(eval(input())) +import sys + +input = sys.stdin.readline +s = input().rstrip() +t = input().rstrip() -    if S[i] == T[i]: +    if s[i] == t[i]: