func main2(text1: [Character] = Array(readLine()!), text2: [Character] = Array(readLine()!)) {
    let text2Count = text2.count
    var result = text2Count
    for index in text1.startIndex...(text1.endIndex - text2Count) {
        var difference = 0
        for (character1, character2) in zip(text1[index...], text2) where character1 != character2 {
            difference += 1
        }
        if result > difference {
            result = difference
        }
    }
    print(result)
}

main2()