fun main(args: Array<String>) {
    val i1 = readLine()!!.toList()
    val i2 = readLine()!!.toList()
    val res =
        i1
            .zip(i2)
            .filter { it.first == it.second }
            .count()
    println(res)
}