Problem:
 Score : 100 points    Problem Statement You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i -th character (1 \leq i \leq 3) of S represents the forecast for the i -th day. S , C , and R stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i -th character (1 \leq i \leq 3) of S represents the actual weather on the i -th day. S , C , and R stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.      Constraints  S and T are strings of length 3 each.  S and T consist of S , C , and R .         Input Input is given from Standard Input in the following format:  S  T       Output Print the number of days for which the forecast was correct.        Sample Input 1 CSS
CSR      Sample Output 1 2   For the first day, it was forecast to be cloudy, and it was indeed cloudy.  For the second day, it was forecast to be sunny, and it was indeed sunny.  For the third day, it was forecast to be sunny, but it was rainy.   Thus, the forecast was correct for two days in this case.       Sample Input 2 SSR
SSR      Sample Output 2 3       Sample Input 3 RRR
SSS      Sample Output 3 0

Solution (Python):
s, t = [input() for _ in range(2)]
print(sum(x==y for x, y in zip(s, t)))

Solution (Python):
a= input()
b=input()
ans=0
for i in range(3):
    if a[i]==b[i]:
        ans+=1
print(ans)

Solution (Python):

S=list(input())
T=list(input())
count=0
for i in range(len(S)):
    if S[i]==T[i]:
        count+=1
    
print(count)

Solution (Python):
S=input()
T=input()
count=0
for i in range(3):
    if S[i]==T[i]:
        count+=1
print(count)

Solution (Python):
while True:
    try:
        W1 = input()
        W2 = input()
        
        ans = 0
        for w1, w2 in zip(W1, W2):
            if w1==w2:
                ans += 1
        print(ans)
    except:
        break

Solution (Python):
def main():
    yoso=input()
    kekka=input()
    cnt=0
    for c1,c2 in zip(yoso,kekka):
        if c1==c2:cnt+=1
    print(cnt)

main()

Solution (Python):
S = input()
T = input()

ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)

Solution (Python):
s = input()
t = input()

c = 0
for i in range(len(s)):
	if s[i] == t[i]:
		c+=1
print(c)

Solution (Python):
S = raw_input()
T = raw_input()
print sum(s==t for s,t in zip(S,T))

Solution (Python):
S = input()
T = input()

ans = 0
for i in range(len(S)):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(len(S)):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
s=input()
t=input()

ans=0
for i in range(3):
  if s[i]==t[i]:
    ans+=1
  else:
    ans=ans
print(ans)

Solution (Python):


first = input()
second = input()

r = 0
for a, b in zip(first, second):
    if a == b:
        r += 1


print(r)

Solution (Python):
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
print(ans)

Solution (Python):
S = input()
T = input()

c = 0
for i in range(3):
    if S[i] == T[i]:
        c += 1
print(c)

Solution (Python):
S = input().strip()
T = input().strip()
count = 0
for s, t in zip(S, T):
	if s == t:
		count += 1
print(count)

Solution (Python):
yohou = list(input())
tenki = list(input())

count = 0
for i in range(len(yohou)):
    if yohou[i] == tenki[i]:
        count +=1
    else:
        pass

print(count)

Solution (Python):
def main():
    S = input()
    T = input()
    ans = 0
    for s, t in zip(S, T):
        if s == t:
            ans += 1

    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
S=input()
T=input()
print(sum(x==y for x,y in zip(S,T)))

Solution (Python):
s = input()
t = input()
c = 0
for i in range(len(s)):
  if (s[i] == t[i]):
    c += 1
print(c)

Solution (Python):
forecast=input()
weather=input()
ans=0
for i in range(3):
    if forecast[i]==weather[i]:
        ans+=1
print(ans)

Solution (Python):

mod = 1000000007
ii = lambda :  int(input())
si = lambda :  input()
dgl = lambda : list(map(int, input()))
f = lambda :   map(int, input().split())
il = lambda :  list(map(int, input().split()))
it = lambda :  tuple(map(int, input().split()))
ls = lambda :  list(input())
c=0
for i, j in zip(si(),si()):
    c+=(i==j)
print(c)

Solution (Python):
S = input()
T = input()

answer = 0

for i in range(3):
  if S[i] == T[i]:
    answer += 1

print(answer)

Solution (Python):
a=input()
b=input()
ans=0
for i in range(3):
  if a[i]==b[i]:
    ans+=1
    
print(ans)

Solution (Python):
import sys
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

s=input()
t=input()
c=0
for i in range(3):
  if s[i]==t[i]:
    c+=1
print(c)

Solution (Python):
s = str(input())
t = str(input())
count = 0
for i in range(3):
  if s[i] == t[i]:
    count += 1
print(count)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

s = input()
t = input()

count = 0
for i in range(3):
    if (s[i] == t[i]):
        count += 1

print(count)

Solution (Python):
s = input()
t = input()
ans = 0
if s[0] == t[0]:
  ans  +=1

if s[1] == t[1]:
  ans  +=1
  
if s[2] == t[2]:
  ans  +=1
print(ans)

Solution (Python):
S=input()
T=input()

c=0

for i in range(3):
    if S[i]==T[i]:
        c+=1

print(c)

Solution (Python):
s = input()
t = input()

cnt = 0

for i in range(3):
    if s[i] == t[i]:
        cnt += 1
        
print(cnt)

Solution (Python):
S = input()
T = input()

counter = 0

for i in range(len(S)):
    if S[i] == T[i]:
        counter += 1

print(counter)

Solution (Python):
S = input()
T = input()

ans = (S[0] == T[0]) + (S[1] == T[1]) + (S[2] == T[2])
print(ans)

Solution (Python):
n = list(input())
s = list(input())

count = 0
for i in range(3):
  if n[i] == s[i]:
    count += 1
    
print(count)

Solution (Python):
S = input()
T = input()

ans = 0
for s, t in zip(S, T):
    if s == t:
        ans += 1

print(ans)

Solution (Python):
s=input()
t=input()
c=0
for i in range(3):
    if s[i]==t[i]:
        c+=1
print(c)

Solution (Python):
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]





S = input()
T = input()

ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
s = list(input())
t = list(input())

ans=0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
print(ans)

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
s=list(input())
t=list(input())
cnt=0
for i in range(3):
  if s[i]==t[i]:
    cnt+=1
print(cnt)

Solution (Python):
a = input()
b = input()

ans = 0

for i in range(3):
    if a[i] == b[i]:
        ans += 1
        
print(ans)

Solution (Python):


import sys




s=input()
t=input()


acount=0
for i in range(0,3):
	if(s[i]==t[i]):
		acount+=1
print(acount)

Solution (Python):
S = input()
T = input()
a = 0

for i in range(3):
  if S[i] == T[i]:
    a += 1
    
print(a)

Solution (Python):
p = list(input())
o = list(input())
count = 0
for i, j in zip(p, o):
  if i == j:
    count += 1
print(count)

Solution (Python):
S=list(input())
T=list(input())

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

Solution (Python):


from collections import deque, defaultdict
import itertools as ite
import sys
import math
import re

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

S = raw_input()
T = raw_input()

ans = 0

for i in range(3):
    if S[i] == T[i]:
        ans += 1

print ans

Solution (Python):
s = input()
t = input()
ans = 0

for i in range(3):
  if(s[i] == t[i]):
    ans += 1
    
print(ans)

Solution (Python):
S = input()
T = input()

cnt = 0
for i in range(len(S)):
    if S[i] == T[i]: cnt+=1

print(cnt)

Solution (Python):
s=input()
t=input()
ans=0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
print(ans)

Solution (Python):
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
print(ans)

Solution (Python):

"""
Created on Sun Sep  1 20:21:30 2019

@author: Yamazaki Kenichi
"""

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

Solution (Python):
s = input()
t = input()
c = 0
for i in range(len(s)):
    c += s[i]==t[i]
print(c)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	S = input()
	S = S[:-1]
	T = input()
	T = T[:-1]

	ans = 0
	if S[0] == T[0]:
		ans += 1
	if S[1] == T[1]:
		ans += 1
	if S[2] == T[2]:
		ans += 1

	print(ans)

if __name__ == "__main__":
	main()

Solution (Python):
s=input()
t=input()
ans=0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
print(ans)

Solution (Python):
S = input()
T = input()
N = 3
count = 0
for i in range(N):
    if S[i] == T[i]:
        count += 1
print(count)

Solution (Python):
n = input()
m = input()

ct = 0
for i in range(3):
  if (n[i] == m[i]):
    ct += 1
print(ct)

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

Solution (Python):
s = input()
t = input()

count = 0
for i in range(3):
    if s[i] == t[i]:
        count += 1
print(count)

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

Solution (Python):


S = list(input())
T = list(input())

cnt = 0

for (i, j) in zip(S, T):
    if i == j:
        cnt += 1

print(cnt)

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

s = input()
t = input()
ct = 0
for i in range(3):
    if s[i] == t[i]:
        ct += 1
print(ct)

Solution (Python):

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

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)

Solution (Python):
import sys


def input(): return sys.stdin.readline().strip()


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


if __name__ == "__main__":
    main()

Solution (Python):
yoho=list(input())
kansoku=list(input())
counter=0
for i in range(3):
    if yoho[i]==kansoku[i]:
        counter+=1
print(counter)

Solution (Python):
s = input()
t = input()

cnt = 0
for si, ti in zip(s, t):
  if si == ti:
    cnt += 1
    
print(cnt)

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
s = input()
t = input()
res = 0
for a, b in zip(s, t):
    if a == b: res += 1
print(res)

Solution (Python):
s = input()
t = input()

cnt = 0
for a, b in zip(s,t):
    if a == b:
        cnt += 1

print(cnt)

Solution (Python):
s = input()
t = input()
ans = 0
for _ in range(3):
    if s[_] == t[_]:
        ans += 1

print(ans)

Solution (Python):
s = list(input())
t = list(input())
ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
print(ans)

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(3):
  if S[i] == T[i]:
    ans += 1
print(ans)

Solution (Python):
import sys
input=sys.stdin.readline

def main():
    S = input().strip()
    T = input().strip()
    n = 0
    for i in range(3):
        if S[i] == T[i]:
            n += 1
    print(n)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
print(ans)

Solution (Python):
s = input()
t = input()

count = 0
if s[0]==t[0]:
    count += 1
if s[1]==t[1]:
    count += 1
if s[2]==t[2]:
    count += 1
print(count)

Solution (Python):
s = input()
t = input()
ctr = 0
for i in range(len(s)):
    if s[i] == t[i]:
        ctr += 1
print(ctr)

Solution (Python):
S = input()
T = input()

myans = 0

for i in range(3):
    if S[i] == T[i]:
        myans += 1

print(myans)

Solution (Python):
pred = input()
actu = input()

cnt = 0
for p, a in zip(pred,actu):
    if p == a:
        cnt+=1
print(cnt)

Solution (Python):
S = input()
T = input()

counter = 0

for i in range(len(S)):
    if S[i] == T[i]:
        counter += 1

print(counter)

Solution (Python):
S = input()
T = input()
a = 0
for s,t in zip(S, T):
    if s==t:
        a+=1
print(a)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

S = list(input())
T = list(input())

ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)

Solution (Python):
s = input()
t = input()
ans = 0
ans += s[0] == t[0]
ans += s[1] == t[1]
ans += s[2] == t[2]

print(ans)

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
else:
    print(ans)

Solution (Python):
S = input()
T = input()

count = 0

for i in range(len(S)):

    if S[i]==T[i]:
        count = count + 1

print(count)

Solution (Python):
a = list(input())
b = list(input())
p = 0
for i in range(3):
  if a[i] == b[i]:
    p += 1
print(p)

Solution (Python):
s = list(input())
t = list(input())
count = 0
for i in range(3):
    if s[i] == t[i]:
        count += 1
print(count)

Solution (Python):
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    S = input()
    T = input()
    count = 0
    for i in range(3):
        if S[i] == T[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

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

Solution (Python):
S = input()
T = input()
ans = 0
for s, t in zip(S, T):
    if s == t:
        ans += 1
print(ans)

Solution (Python):
s = input()
t = input()

count = 0
for i in range(3):
    if s[i] == t[i]:
        count += 1

print(count)

Solution (Python):
s = input()
t = input()
count = 0
for i, j in zip(s, t):
    if i == j:
        count += 1
print(count)

Solution (Python):

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

Solution (Python):
S = input()
T = input()

c = 0
for i in range(3):
    if S[i] == T[i]:
        c += 1
print(c)

Solution (Python):
s = input()
t = input()
ans = 0 
i = 0
for i in range(3):
  if s[i] == t[i]:
    ans += 1
print(ans)

Solution (Python):

s1 = input()
s2 = input()

ans = 0
for i in range(3):
    if s1[i] == s2[i]:
      ans+= 1
print(ans)

Solution (Python):


s = raw_input()
t = raw_input()
ans = 0
for i in xrange(3):
  if s[i] == t[i]:
    ans += 1
print ans

Solution (Python):
S = list(input())
T = list(input())
print(len([0 for s, t in zip(S, T) if s == t]))

Solution (Python):
s = input()
t  = input()

count = 0
for i in range(len(s)):
    if s[i]==t[i]:
        count += 1
print(count)

Solution (Python):
s = input()
t = input()
ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
print(ans)

Solution (Python):

import sys


def solve(S: str, T: str):
    count =0
    for s, t in zip(S, T):
        if s==t:
            count+=1
    print(count)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    T = next(tokens)  
    solve(S, T)

if __name__ == '__main__':
    main()

Solution (Python):
S=input()
T=input()

ans=0
for i in range(3):
    if S[i]==T[i]:
        ans+=1

print(ans)

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

Solution (Python):
S = input().strip()
T = input().strip()
cnt = 0
for i in range(3):
    if S[i]==T[i]:
        cnt += 1
print(cnt)

Solution (Python):
s = input()
t = input()

cnt = 0

for i in range(3) :
    if s[i] == t[i] :
        cnt += 1

print(cnt)

Solution (Python):
s = input()
t = input()
print(sum(1 for ss, tt in zip(s, t) if ss == tt))

Solution (Python):
s = input()
t = input()
ans = 0
for i in range(3):
    if s[i]==t[i]: ans += 1
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

debug = True


def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    s = SI()
    t = SI()

    cnt = 0
    if s[0] == t[0]:
        cnt += 1
    if s[1] == t[1]:
        cnt += 1
    if s[2] == t[2]:
        cnt += 1
    print(cnt)

solve()

Solution (Python):
s = input()
t = input()
print((s[0]==t[0]) + (s[1]==t[1]) + (s[2]==t[2]))

Solution (Python):
S = input()
T = input()

ans = 0
for s, t in zip(S, T):
    if s == t:
        ans += 1

print(ans)

Solution (Python):
s = input().rstrip()
t = input().rstrip()
ans = 0
for a, b in zip(s, t):
    if a == b:
        ans += 1
print(ans)

Solution (Python):
S = input().strip()
T = input().strip()
print(sum(s == t for s, t in zip(S, T)))

Solution (Python):
s = input()
t = input()
a = 0
for i in range(3):
    if s[i] == t[i]:
        a += 1
print(a)

Solution (Python):

import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a = list(read())
b = list(read())

cnt = 0
for i in range(3):
    if a[i] == b[i]:
        cnt += 1
print(cnt)

Solution (Python):
S = list(input())
T = list(input())
ans = 0
for i in range(3):
    if S[i] == T[i]:    ans += 1

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return str(sys.stdin.readline())

def main():
    s = S()
    t = S()
    ans = 0
    for i in range(3):
        if s[i] == t[i]:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
print(sum(1 for a, b in zip(input(), input()) if a == b))

Solution (Python):
s = str(input())
t = str(input())
ans=0
for i in range(len(s)):
    if s[i] == t[i]:
        ans+=1
print(ans)

Solution (Python):

def solve():
    res = sum(s==t for s,t in zip(input(), input()))
    return str(res)

if __name__ == '__main__':
    print(solve())

Solution (Python):
S=input()
T=input()
print(sum(s==t for s,t in zip(S,T)))

Solution (Python):
s = list(input())
t = list(input())
ans = 0

for i in range(3):
    if s[i] == t[i]:
        ans += 1

print(ans)

Solution (Python):
s = input()
t = input()
c = 0
for i in range(3):
    if s[i] == t[i]:
        c += 1
print(c)

Solution (Python):
S=input()
T=input()
cnt=0
for i in range(len(S)):
    if S[i] == T[i]:
        cnt+=1
print(cnt)

Solution (Python):
S=input()
T=input()
count=0
for i in range(3):
    if S[i]==T[i]:
        count+=1
print(count)

Solution (Python):
S = input()
T = input()

ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)

Solution (Python):
S = input()
T = input()

cnt = 0
for s, t in zip(S, T):
    if s==t: cnt+=1

print(cnt)

Solution (Python):
S = input()
T = input()

cnt = 0
for i in range(len(S)):
    if S[i]==T[i]:
        cnt+=1

print(cnt)

Solution (Python):
S = input()
T = input()
cnt = 0
for s, t in zip(S, T):
    cnt += (s==t)
print(cnt)

Solution (Python):
S=input()
T=input()
print(len([(x,y) for (x,y) in zip(list(S),list(T)) if x==y]))

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

Solution (Python):
import sys

s = input()
t = input()

ans = 0
for si, ti in zip(s,t):
    if si == ti:
        ans += 1

print(ans)

Solution (Python):
s=input()
t=input()
ans=0
for i,j in zip(s,t):
  if i==j:
    ans+=1
print(ans)

Solution (Python):
S = input()
T = input()

ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
S = list(input())
T = list(input())

count = 0
for i in range(3):
    if S[i] == T[i]:
        count += 1

print(count)

Solution (Python):
S = input()
T = input()

ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
"""
N = int(input())
N,M = map(int,input().split())
N_list = list(map(int,input().split()))
"""




S = input()
T = input()


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

Solution (Python):
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    T = inputs[1]

    count = 0
    for i in range(3):
        if S[i] == T[i]:
            count += 1
    return count


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)

Solution (Python):
import sys
MAX_INT = int(10e9)
MIN_NUM = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
t = S()

cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)

Solution (Python):
S = input()
T = input()
c = 0
for i in range(len(S)):
  if S[i] == T[i]:
    c += 1
print(c)

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

Solution (Python):
s = input()
t = input()
count = 0
for si,ti in zip(s,t):
    if si == ti:
        count += 1
print(count)

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
s=input()
t=input()
ans=0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(1000000)
from math import factorial, ceil, floor
from bisect import bisect_right as bsr
from operator import itemgetter as ig
from collections import defaultdict as dd
from collections import deque, Counter as cnt


args = None
INF = float("inf")
MOD = int(1e9 + 7)
def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]
def nlist(n, v):
    if not n: return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def main():
    S = input(str)
    T = input(str)

    count = 0
    for a, b in zip(list(S), list(T)):
        if a == b:
            count += 1
    print(count)

if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

Solution (Python):
S = input()
T = input()

cnt = 0
for i in range(len(S)):
    if S[i] == T[i]:
        cnt += 1
print(cnt)

Solution (Python):
s = input()
t = input()
cnt = 0
for i in range(3):
    if s[i] == t[i]:
        cnt += 1
print(cnt)

Solution (Python):
s=input()
t=input()
ct=0
for i in range(len(s)):
    if s[i]==t[i]:
        ct+=1
print(ct)

Solution (Python):
S = str(input())
T = str(input())

ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)

Solution (Python):
s = input()
t = input()
ans = 0

for s, t in zip(s,t):
  if s==t:
    ans += 1
print(ans)

Solution (Python):
def solve():
    data = read()
    result = think(data)
    write(result)


def read():
    return [read_line(), read_line()]


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(data):
    d1, d2 = data[0], data[1]
    count = 0
    for i in range(len(d1)):
        if d1[i] == d2[i]:
            count += 1
    return count


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Solution (Python):
from sys import stdin
s = stdin.readline().rstrip()
t = stdin.readline().rstrip()
count = 0

for i in range(3):
  if s[i] == t[i]:
    count += 1
    
print(count)

Solution (Python):
S = input()
T = input()
count = 0
for i in range(3):
    if S[i] == T[i]:
        count += 1
print(count)

Solution (Python):
S = input()
T = input()
count = 0
for i in range(3):
    if S[i] == T[i]:
        count += 1
print(count)

Solution (Python):
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1

print(ans)

Solution (Python):

s = input()
t = input()
print(sum([int(i == j) for i, j in zip(s, t)]))

Solution (Python):
S = input()
T = input()
print([s==t for (s,t) in zip(S,T)].count(True))

Solution (Python):
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans+=1
print(ans)

Solution (Python):
s=input()
t=input()
ans=0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
print(ans)

Solution (Python):
S = input()
T = input()

flag = 0
for i in range(3):
    if S[i] == T[i]:
        flag += 1
        
print(flag)

Solution (Python):
S = input()
T = input()

c = 0
for i in range(3):
    if S[i] == T[i]:
        c += 1

print(c)

Solution (Python):
S=str(input())
T=str(input())
ans=0
for i in range(0,3):
    if(S[i]==T[i]):
        ans+=1
print(ans)

Solution (Python):
s=input()
t=input()
cnt=0
for i in range(3):
  if s[i]==t[i]:
    cnt+=1
print(cnt)

Solution (Python):
S = input()
T = input()
ans = 0
for n in range(3):
    if S[n]==T[n]:
        ans += 1
print(ans)

Solution (Python):
S = input()
T = input()
ans = 0
for s, t in zip(S,T):
  if s == t:
    ans+=1
print(ans)

Solution (Python):
S = input()
T = input()
print([s == t for s, t in zip(S,T)].count(True))

Solution (Python):



def solve(S, T):
    return sum(s == t for s, t in zip(S, T))


if __name__ == '__main__':
    S = input()
    T = input()

    ans = solve(S, T)

    print(ans)

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
S = input()
T = input()
c = 0
for i in range(3):
    if S[i] == T[i]:
        c += 1

print(c)

Solution (Python):
S = input()
T = input()
print(sum(s==t for s, t in zip(S,T)))

Solution (Python):
import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)




def main():
    n = input()
    m = input()

    ans = 0

    for i in range(3):
        if n[i] == m[i]:
            ans += 1

    print(ans)
    

if __name__ == '__main__':
    main()

Solution (Python):
import math
import collections
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def main():
    s = input()
    t = input()
    ans = 0
    for i in range(3):
        if s[i] == t[i]:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
S = input()
T = input()

ans = 0
for i in range(len(S)):
    if(S[i]==T[i]):
        ans += 1

print(ans)

Solution (Python):
s = input()
t = input()
c = 0

for i in range(3):
  if s[i] == t[i]:
    c += 1

print(c)

Solution (Python):
s = input()
t = input()
ans = 0
for i in range(3):
  if s[i] == t[i]:
    ans+=1
print (ans)

Solution (Python):
S = list(input())
T = list(input())

ans = 0
for i in range(len(S)):
    if S[i] == T[i]:
        ans += 1

print(ans)

Solution (Python):
S = list(input())
T = list(input())
ctr = 0

for i in range(3):
  if S[i] == T[i]:
    ctr += 1
print(ctr)

Solution (Python):
S = input()
T = input()

ans = 0
for i in range(3):
  if S[i] == T[i]:
    ans += 1
    
print(ans)

Solution (Python):
s=input()
r=input()
count=0
for i in range(3):
  if s[i]==r[i]:
    count+=1
    
print(count)

Solution (Python):
S = input()
T = input()
count = 0

for i in range(3):
    if S[i] == T[i]:
        count += 1

print(count)

Solution (Python):
S = input()
T = input()

cnt = 0

for i in range(3):
    if S[i] == T[i]:
        cnt += 1

print(cnt)

Solution (Python):
s = input()
t = input()
result = 0
for i in range(3):
    if s[i] == t[i]:
        result += 1
print(result)

Solution (Python):
S=input()
T=input()
cnt=0
for s,t in zip(S, T):
	if s==t:cnt+=1
print(cnt)

Solution (Python):



import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline





s = input()
t = input()

ans = 0
for i,j in zip(s,t):
    if i==j: ans += 1
print(ans)

Solution (Python):
s = input()
t = input()

count = 0
for i,j in zip(s, t):
    if i == j:
        count += 1
        
print(count)

Solution (Python):
import sys
input = sys.stdin.readline

S = input()
T = input()
ans = 0;
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
S = str(input())
T = str(input())
count = 0
for i in range(3):
    if S[i]==T[i]:
        count += 1
print(count)

Solution (Python):
import math
import queue

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b):
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a):
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def main():
    s = input()
    t = input()
    ans = 0
    for i in range(len(s)):
        if s[i]==t[i]:
            ans += 1
    print(ans)
    return

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
t = input()
ans = 0
if s[0] == t[0]:
    ans+=1
if s[1] == t[1]:
    ans+=1
if s[2] == t[2]:
    ans+=1

print(ans)