func mainB() {
    let S: [Character] = .init(readLine()!)
    let T: [Character] = .init(readLine()!)

    let Scount = S.count
    let Tcount = T.count

    var results: [Int] = []
    for i in 0...Scount-Tcount {

        var count = 0
        for j in 0..<Tcount {

            if S[i + j] == T[j] {
                count += 1
            }
        }
        results.append(Tcount - count)
    }

    print(results.min()!)
}
mainB()