S = eval(input())

T = eval(input())



cnt, i = 0, 0



for s in S:

    if s == T[i]:

        cnt += 1

    i += 1



print(cnt)
S = eval(input())

T = eval(input())



count = 0

for s,t in zip(S,T):

    if s == t:

        count+=1

    

print(count)
S = eval(input())
T = eval(input())
cnt, i = 0, 0
for s in S:
    if s == T[i]:
        cnt += 1
    i += 1
print(cnt)

S = eval(input())
T = eval(input())
count = 0
for s, t in zip(S, T):
    if s == t:
        count += 1
print(count)

-cnt, i = 0, 0 -for s in S: -    if s == T[i]: -        cnt += 1 -    i += 1 -print(cnt) +count = 0 +for s, t in zip(S, T): +    if s == t: +        count += 1 +print(count)