fun main() {
    val s = readLine()?.toList() ?: listOf()
    val t = readLine()?.toList()?:  listOf()

    var index  = 0
    s.forEachIndexed { idx, value ->
        if (value === t[idx]) {
            index++
        }
    }

    println(s.size - index)
}