fun main(args: Array<String>) {
    val s = readLine()!!.split("").filter { it.isNotEmpty() }
    val t = readLine()!!.split("").filter { it.isNotEmpty() }

    println(op139a(s,t))
}

fun op139a(s: List<String>, t: List<String>): Int {
    return s.filterIndexed { index, string ->
        string == t[index]
    }.count()
}


