program main
    implicit none
    character(1000)::s,t
    integer::n,m,ans,i,j,nm
    integer,allocatable::aaa(:)

    ans=0

    read*,s,t
    !print*,s,t

    n=len_trim(s)
    m=len_trim(t)
    nm=n-m
    !print*,n,m,nm
    allocate(aaa(nm+1))
    !print*,s(n:n),t(m:m)
    if(nm==0) then
        do i=1,m
            if(s(i:i)/=t(i:i)) then
                !print*,s(i:i)
                ans=ans+1
            end if
        end do
        go to 100
    end if

    
    ans=0
    if(nm>0) then
        !print*,s(1:1)
        do i=1,nm+1
            aaa(i)=0
            do j=i,m+i
               ! print*,s(j:j)
                if(s(j:j)/=t(j-i+1:j-i+1)) then
                   ! print*,s(j:j)
                    aaa(i)=aaa(i)+1
                end if
            end do
        end do
        ans=minval(aaa)
    end if

100 print*,ans
end program main