
Imports System.Console
Module Module1
    Dim ans As Int64
    Dim max, min As Int64
    Dim n, k, x, t, d As Int64
    Sub Main()
        Dim s As String = ReadLine()
        Dim tt As String = ReadLine()
        Dim tlon As Integer = tt.Length
        min = 2 ^ 31
        For i = 0 To s.Length - tlon
            Dim w As Integer = Diff(tt, s.Substring(i, tlon))
            If w <= min Then
                min = w
            End If
        Next
        WriteLine(min)
        ReadLine()
    End Sub
    Function Diff(s1 As String, s2 As String) As Integer
        Dim c1() As Char = s1.ToCharArray
        Dim c2() As Char = s2.ToCharArray
        Dim ret As Integer
        For i = 0 To c1.Length - 1
            If c1(i) <> c2(i) Then
                ret += 1
            End If
        Next
        Return ret
    End Function
    Sub Add(ByRef arr() As Integer, ByVal num As Integer)
        If arr Is Nothing Then
            ReDim arr(0)
            arr(0) = num
        Else
            ReDim Preserve arr(arr.Length)
            arr(arr.Length - 1) = num
        End If
    End Sub
End Module
