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 in Ruby (2.3.3) (judge verdict: Runtime Error)

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def r_sort(a) a.sort{|a,b|b<=>a} end

n = inp[0]
t = []
n.times do|i|
  d = inp
  next if(d[0] == 0 and d[1] == 0)
  ka = d[0]/d[1].to_f
  tails = Math.atan(ka)*180/Math::PI
  tails +=180 if(d[1]<0)
  t.push([tails.to_f,d[0],d[1]])
end
x = y = 0
ans = 0
tail =0

sum = 0
t.sort_by!{|u|u[0]}
tails = t[0][0]

t.each do |a|
  nt = a[0]
  x += a[1]
  y += a[2]
  while(tails < 90.00 and tail < t.size)
    ans = [ans,(x**2+y**2)**0.5].max
    x -= t[tail][1]
    y -= t[tail][2]
    tail += 1
    tails = t[tail][0]
  end
  ans = [ans,(x**2+y**2)**0.5].max
end
p ans

=begin
def search(t,d, ind)
  ans = 0
  return
end
n = inp[0]
@memo = na2(n,n,false)
n.times do |i|
  @memo[i][0] = 0
end
@mem = na2(n+1,n+1)
a = []
n.times do |i|
  a[i] = inp
end
n.times do |i|
  (n-1).times do|j|
    p 7
    @mem[i+1][a[i][j]] = j
  end
end
@mem.each do|a|
  p a
end
=end