open Batteries
(* 文字列をcharのlistにする *)
let explode s = List.init (String.length s) (String.get s)
let s = read_line()|>explode
let t = read_line()|>explode
let rec loop lst lst2 result =
  match (lst, lst2) with
  | ([],[]) -> result
  | (first :: rest, first2 :: rest2) -> if first = first2 then loop rest rest2 (result) else loop rest rest2 (result+1)
  | _ -> result
let _ = Printf.printf "%d\n" @@ loop s t 0