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):
class Solution:
    def main(self):
        s = input()
        t = input()
        res = 0
        for i in range(3):
            if s[i] == t[i]:
                res += 1
        print(res)

if __name__ == '__main__':
    Solution().main()

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

Solution (Python):

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

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):

from sys import stdin




def _li(): return list(map(int, stdin.readline().split()))
def _li_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def _lf(): return list(map(float, stdin.readline().split()))
def _ls(): return stdin.readline().split()
def _i(): return int(stdin.readline())
def _f(): return float(stdin.readline())
def _s(): return stdin.readline()[:-1]


S = _s()
T = _s()

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()
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 elem1, elem2 in zip(s, t):
    if elem1 == elem2:
        cnt += 1
print(cnt)

Solution (Python):
import sys

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

    print(ans)

if __name__ == "__main__":
    resolve()

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 = 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()
c = 0
for i in range(3):
    if s[i] == t[i]:
        c+=1
print(c)

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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()
ans = 0
for i in range(3):
    if S[i]==T[i]:
        ans += 1
print(ans)

Solution (Python):
def getlist():
    return list(map(int, input().split()))

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()
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())

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()

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

print(cnt)

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

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

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()
ans = 0
for s, t in zip(S, T):
    if s == t:
        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()
c = sum(1 if i == j else 0 for i, j in zip(s, t))
print(c)

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

S =  sys.stdin.readline().rstrip()
T =  sys.stdin.readline().rstrip()

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)

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()
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 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()
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()

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 cs, ct in zip(s, t):
    if cs == ct:
        cnt += 1

print(cnt)

Solution (Python):

import sys
INF = float("inf")


def solve(S: str, T: str):
    print(sum([s == t for s, t in zip(S, T)]))
    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()

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

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()

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 = input()
t = input()
a=0
a+=(s[0]==t[0])+(s[1]==t[1])+(s[2]==t[2])
print(a)

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 s,t in zip(S,T):
	if s == t:
		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 = input()
T = input()

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

print(count)

Solution (Python):
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(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()
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 a,b in zip(s,t):
    if a == b:
        ans += 1
print(ans)

Solution (Python):

S = list(str(input()))
T = list(str(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(0,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()

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

Solution (Python):
s = input()
t = input()
ans = sum(i==j for i,j in zip(s, t))
print(ans)

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

cnt = 0
for f, r in zip(s, t):
    if f == r:
        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()

print(sum(s == t for s, t in zip(S, T)))

Solution (Python):

import sys


def solve(S: str, T: str):
    count = 0
    for i in range(3):
        if S[i] == T[i]:
            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()
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 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()

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

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    S = ST()
    T = ST()
    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
ans += 1 if S[0]==T[0] else 0
ans += 1 if S[1]==T[1] else 0
ans += 1 if S[2]==T[2] else 0
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 = list(input())
T = list(input())
ans = 0
for s, t in zip(S, T):
    if s == t:
        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()
ans = 0

for s, t in zip(S, T):
    if s == t:
        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):
words = lambda t : list(map(t, input().split()))
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()
a = 0
for i in range(3):
    if S[i] == T[i]:
        a += 1
print(a)

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 a, b in zip(s, t):
  if a == b:
    cnt += 1
print(cnt)

Solution (Python):



import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().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

stdin = sys.stdin

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

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

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):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



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

    print(cnt)

main()

Solution (Python):
s = input()
t = input()
print(len([x for x, y in zip(s, t) if x == y]))

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):

import sys
sys.setrecursionlimit(300000)


def solve(S: str, T: str):
    ret = 0
    for i in range(3):
        if S[i] == T[i]:
            ret += 1
    print(ret)
    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()
c=0
for i in range(3):
    if s[i]==t[i]:c+=1
print(c)

Solution (Python):
rr = raw_input
rri = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())


def solve(S,T):
    return sum(s==t for s,t in zip(S,T))
    
S,T=rr(),rr()
print solve(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()
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):
S1 = input()
S2 = input()
print(sum([int(s[0] == s[1]) for s in zip(S1, S2)]))

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()

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

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

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

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

Solution (Python):


import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()
T = input()

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

print(ans)

Solution (Python):


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=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()
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 i in range(len(S)):
    if S[i] == T[i]:
        ans += 1
print(ans)

Solution (Python):
s=list(input())
t=list(input())
c=0
for i, v in zip(s, t):
    if i==v:
        c+=1
print(c)

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

count = 0
for aa, bb in zip(a, b):
    if aa == bb:
        count += 1

print(count)

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

s = input().split() 
s = list(s[0])
t = input().split() 
t = list(t[0])
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()
ans = 0
for s, t in zip(S, T):
    if s == t:
        ans += 1

print(ans)

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=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 k in range(3):
    if S[k] == T[k]:
        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 = list(input())
T = list(input())
cnt = 0
for i in range(3):
    if S[i] == T[i] :cnt+= 1
    
print(cnt)

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

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

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 = list(str(input()))
t = list(str(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 i in range(3):
	if s[i] == t[i]:
		ans += 1
print(ans)

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

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()

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

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

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

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

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


s = ns()
t = ns()

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 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):
from sys import stdin

S = stdin.readline().rstrip()
T = stdin.readline().rstrip()

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):
    ans += S[i] == T[i]
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):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007


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


def B():

    return


def C():

    return


def D():

    return


def E():

    return


def F():

    return


if __name__ == "__main__":
    A()

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

print(sum([s[i] == t[i] for i in range(3)]))

Solution (Python):
Ss = input()
Ts = input()

ans = 0
for S, T in zip(Ss, Ts):
    if S == T:
        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
sys.setrecursionlimit(10**6)


S = list(input().rstrip())
T = list(input().rstrip())

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(len(s)):
    if s[i]==t[i]:
        ans += 1
print(ans)

Solution (Python):

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

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

def main():
    
    
    
    s = input().strip()
    t = input().strip()
    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(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):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

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()
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
sys.setrecursionlimit(200000)
input = sys.stdin.readline

S = input().strip()
T = input().strip()

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 bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

S = np.array(list(sys.stdin.readline().rstrip()))
T = np.array(list(sys.stdin.readline().rstrip()))

print((S == T).sum())

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

Solution (Python):


import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop

def main():
    sl = input()
    tl = input()
    ans = 0
    for s, t in zip(sl, tl):
        if s == t:
            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()
ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
print(ans)

Solution (Python):
a = input()
b = input()
c = 0
for i in range(3):
  if a[i] == b[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):
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    t = str(input().rstrip('\n'))
    cnt = 0
    for i in range(3):
        if s[i] == t[i]:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()

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

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