program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: i,j,ans,x
    character(1000):: s,t

    read*, s,t

    ans = 100000000

    do i=1,len_trim(s)-len_trim(t)+1
        x=0
        do j=1,len_trim(t)
            if (s(j+i-1:j+i-1) /= t(j:j)) x=x+1
        end do
        ans = min(x,ans)
    end do
    print'(i0)', ans
end program main