
import java.util.Scanner



object Main {

  def read(): (String, String) = {
    val sc: Scanner = new Scanner(System.in)
    val s = sc.next
    val t = sc.next
    sc.close()
    (s, t)
  }


  def solve(s: String, t: String): Long = {
    s.length - s.split("").diff(t.split("")).length
  }


  def main(args: Array[String]): Unit = {
    val (s, t) = read()
    println(solve(s, t))
  }

}
