program ABC177B
    implicit none
    integer(8)::i,j,ans=100000000,calc
    character(1000)::S,T
    read*,S,T
    do i=1,len_trim(S)-len_trim(T)+1
        calc=0
        do j=1,len_trim(T)
            if(S(i+j-1:i+j-1)/=T(j:j))calc=calc+1
        end do
        ans=min(ans,calc)
    end do
    print'(i0)',ans
end program ABC177B