Imports System

Module Program
    Sub Main(args As String())

        Dim S As String = Console.ReadLine()
        Dim T As String = Console.ReadLine()

        Dim ans As Integer = Len(S)

        For i As Integer = 1 To Len(S) - Len(T) + 1
            Dim kaisu As Integer = 0
            For j As Integer = 1 To Len(T)
                If Mid(S, i + j - 1, 1) <> Mid(T, j, 1) Then
                    kaisu += 1
                End If
            Next
            If ans > kaisu Then
                ans = kaisu
            End If
        Next

        Console.WriteLine(ans)

    End Sub
End Module
