AtCoder Beginner Contest 139 - Tenki

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-----
CSS
CSR

-----Sample Output-----
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.

Difficulty: EASY

Starter code:

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


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


S = input()
T = input()
print(len([True for (s, t) in zip(S, T) if s == t]))


S = input()
T = input()
print(sum([int(S[i] == T[i]) for i in range(3)]))


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


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


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


(x, y, z) = input()
(a, b, c) = input()
print((x == a) + (y == b) + (z == c))


(S, T) = (input() for _ in range(2))
print(sum((s == t for (s, t) in zip(S, T))))


def resolve():
	s = input()
	t = input()
	cnt = 0
	for (i, j) in zip(s, t):
		if i == j:
			cnt += 1
	print(cnt)
resolve()


S = input()
T = input()
print(list((S[i] == T[i] for i in range(3))).count(True))


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


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


print(sum((c is d for (c, d) in zip(input(), input()))))


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


(S, T) = [input() for _ in range(2)]
print(sum((S[i] == T[i] for i in range(3))))


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


f = list(input())
c = list(input())
print(sum((1 for (_f, _c) in zip(f, c) if _f == _c)))


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


s = input()
t = input()
print(len([a == b for (a, b) in zip(s, t) if a == b]))


print(sum((i == j for (i, j) in zip(*open(0).read().split()))))


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


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


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


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


S = input()
T = input()
print(sum([1 for (u, v) in zip(S, T) if u == v]))


a = input()
b = input()
ans = sum((a[i] == b[i] for i in range(3)))
print(ans)


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


s = input()
t = input()
print(int(s[0] == t[0]) + int(s[1] == t[1]) + int(s[2] == t[2]))


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


(a, b) = (input(), input())
c = 0
for (i, j) in zip(a, b):
	if i == j:
		c += 1
print(c)


a = input()
b = input()
print([a[i] == b[i] for i in range(len(a))].count(True))


s = input()
t = input()
ans = len([1 for (si, ti) in zip(s, t) if si == ti])
print(ans)


(S, T) = [input() for _ in range(2)]
count = 0
for (i, j) in zip(S, T):
	if i == j:
		count += 1
print(count)


slist = list(input())
tlist = list(input())
slist_new = [slist[0] + '0', slist[1] + '1', slist[2] + '2']
tlist_new = [tlist[0] + '0', tlist[1] + '1', tlist[2] + '2']
list02 = slist_new + tlist_new
andlist = [x for x in list02 if list02.count(x) > 1]
print(len(andlist) // 2)


print(sum([1 for (x, y) in zip(input(), input()) if x == y]))


ss = input()
tt = input()
print(sum([s == t for (s, t) in zip(ss, tt)]))


print(sum((a == b for (a, b) in zip(*open(0)))) - 1)


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


ans = 0
for (s, t) in zip(input(), input()):
	ans += s == t
print(ans)


S = input()
T = input()
print(sum([int(s == t) for (s, t) in zip(S, T)]))


print(sum([1 for (s, t) in zip(input(), input()) if s == t]))


(A, B) = (input(), input())
print(sum((A[i] == B[i] for i in range(len(A)))))


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

def __starting_point():
	main()
__starting_point()


S = input()
T = input()
print(len([i for i in range(3) if S[i] == T[i]]))


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


s = input()
t = input()
print(sum([x == y for (x, y) in zip(s, t)]))


a = input()
b = input()
print(sum((x == y for (x, y) in zip(a, b))))


S = input
print(sum((u == v for (u, v) in zip(S(), S()))))


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


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


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


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


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


s = input()
t = input()
print([x == y for (x, y) in zip(s, t)].count(True))


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


S = input()
T = input()
ans = [1 for (s, t) in zip(S, T) if s == t]
print(sum(ans))


S = input()
T = input()
cnt = sum((1 for (a, b) in zip(S, T) if a == b))
print(cnt)


print(sum([1 if i == e else 0 for (i, e) in zip(input(), input())]))


A = str(input())
P = str(input())
cnt = 0
for i in range(3):
	if A[i] == P[i]:
		cnt += 1
print(cnt)


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


(S, T) = (input(), input())
print(sum((1 if s == t else 0 for (s, t) in zip(S, T))))


s = input()
t = input()
c = sum((1 if i == j else 0 for (i, j) in zip(s, t)))
print(c)


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


(s, t) = (input() for _ in range(2))
print(sum((s[i] == t[i] for i in range(3))))


s = input()
t = input()
print(len([v for (i, v) in enumerate(s) if t[i] == v]))


S = input()
T = input()
a = 0
for (i, n) in zip(S, T):
	if i == n:
		a += 1
print(a)


Y = input()
S = input()
print(sum([1 for (a, b) in zip(Y, S) if a == b]))


A = input()
B = input()
C = 0
for i in range(3):
	if A[i] == B[i]:
		C += 1
print(C)


S = input()
T = input()
print(sum([1 for i in range(len(S)) if S[i] == T[i]]))


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


(s, t) = (input(), input())
print(sum((c is d for (c, d) in zip(s, t))))


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


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


S = input()
T = input()
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)


S = input()
T = input()
print(sum([1 for i in range(3) if S[i] == T[i]]))


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


s = input()
t = input()
print(sum((1 for i in range(len(s)) if s[i] == t[i])))


s = input()
t = input()
print(len([i for i in range(3) if s[i] == t[i]]))


S = input()
T = input()
count = 0
for (i, j) in zip(S, T):
	if i == j:
		count += 1
print(count)


print(3 - sum((i != j for (i, j) in zip(*open(0)))))


(s, t) = open(0).read().split()
print(sum([j == i for (i, j) in zip(s, t)]))


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


s = input()
t = input()
print(sum([si == ti for (si, ti) in zip(s, t)]))


a = input()
b = input()
print(len([i for i in range(3) if a[i] == b[i]]))


A = input()
B = input()
print(sum((1 for i in range(3) if A[i] == B[i])))


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


(a, b) = (input(), input())
c = 0
for i in [0, 1, 2]:
	c = c + int(a[i] == b[i])
print(c)


cnt = 0
for (a, b) in zip(input(), input()):
	if a == b:
		cnt += 1
print(cnt)


print(len(list(filter(lambda x: x[0] == x[1], zip(input(), input())))))


c = 0
for (a, b) in zip(input(), input()):
	if a == b:
		c += 1
print(c)


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)


s = input()
t = input()
print(sum((s_ == t_ for (s_, t_) in zip(s, t))))


S1 = input()
S2 = input()
print(sum([int(s[0] == s[1]) for s in zip(S1, S2)]))


(s, t) = (input(), input())
print(sum([a == b for (a, b) in zip(s, t)]))


S = input()
T = input()
print(sum([i == j for (i, j) in zip(S, T)]))


s = input()
t = input()
a = 0
a += (s[0] == t[0]) + (s[1] == t[1]) + (s[2] == t[2])
print(a)


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


f = list(input())
a = list(input())
g = 0
if f[0] == a[0]:
	g += 1
if f[1] == a[1]:
	g += 1
if f[2] == a[2]:
	g += 1
print(g)


S = input()
T = input()
print([S[i] == T[i] for i in range(len(S))].count(True))


a = input()
b = input()
print(len([x for (x, y) in zip(a, b) if x == y]))


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


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


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


(S, T) = open(0).read().split()
print(sum([S[i] == T[i] for i in range(3)]))


S = input()
T = input()
print(len([1 for (_s, _t) in zip(S, T) if _s == _t]))


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


S = input()
T = input()
ans = [s == t for (s, t) in zip(S, T)]
print(sum(ans))


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


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


print(sum((a == b for (a, b) in zip(list(input()), list(input())))))


S = input()
T = input()
print(len([1 for (s, t) in zip(S, T) if s == t]))


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


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


print(len([1 for (i, j) in zip(input(), input()) if i == j]))


ss = input()
tt = input()
print(sum([ss[i] == tt[i] for i in range(3)]))


s = input()
t = input()
print(sum((c[0] == c[1] for c in zip(s, t))))


S = input()
T = input()
print(sum([S[k] == T[k] for k in range(3)]))


print(sum(map(lambda x: int(x[0] == x[1]), zip(list(input()), list(input())))))


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


(S, T) = (input(), input())
print(sum((int(a == b) for (a, b) in zip(S, T))))


s1 = input()
s2 = input()
print(sum((s1[i] == s2[i] for i in range(len(s1)))))


n = input()
n1 = input()
ind = 0
c = 0
for i in n1:
	if i == n[ind]:
		c += 1
	ind += 1
print(c)


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


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


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


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


x = input()
y = input()
count = 0
if x[0] == y[0]:
	count += 1
if x[1] == y[1]:
	count += 1
if x[2] == y[2]:
	count += 1
print(count)


print(sum((x == y for (x, y) in zip(input(), input()))))


S = input()
T = input()
PS = [S[i] == T[i] for i in range(3)]
print(sum(PS))


S = input()
T = input()
ans = 0
for (i, j) in zip(S, T):
	ans += i == j
print(ans)


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


print(sum(map(lambda x, y: x == y, input(), input())))


i = input()
s = input()
print(len([u for (u, o) in zip(i, s) if u == o]))


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


S = input()
print(sum([S[i] == x for (i, x) in enumerate(input())]))


(s, t) = (input(), input())
n = 0
for (x, y) in zip(s, t):
	if x == y:
		n += 1
print(n)


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


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


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


c = 0
for (i, j) in zip(input(), input()):
	if i == j:
		c += 1
print(c)


a = input()
b = input()
c = 0
for x in range(3):
	if a[x] == b[x]:
		c = c + 1
print(c)


S = input()
T = input()
print(sum([S[i] == T[i] for i in range(len(S))]))


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


(a, b) = open(0)
c = 0
for i in range(3):
	c += bool(a[i] == b[i])
print(c)


a = input()
b = input()
print(sum((i == j for (i, j) in zip(a, b))))


forecast_list = list(input())
happened_list = list(input())
hit_count = 0
for (f, h) in zip(forecast_list, happened_list):
	if f == h:
		hit_count += 1
print(hit_count)


a = input()
b = input()
c = 0
for i in range(len(a)):
	if a[i] == b[i]:
		c += 1
print(c)