Scanf.scanf "%s %s" (fun s t ->
    let n = String.length s in
    let m = String.length t in
    let diff a b =
        let rec loop i acc =
            if i = m then acc else
                let acc = if a.[i] = b.[i] then acc else acc + 1 in
                loop (i + 1) acc
        in
        loop 0 0
    in
    let rec loop i acc =
        if i + m > n then acc else loop (i + 1) (min acc (diff (String.sub s i m) t))
    in
    loop 0 max_int |> Printf.printf "%d\n"
)