s = gets.chomp.split("")
t = gets.chomp.split("")
kai = s.size - t.size + 1
i = 0
int = []
kai.times do |i|
    arr =  s[i..(i + (t.size)-1)]
    j = 0
    count = 0
    while true
        if arr[j] != t[j]
            count += 1
        end
        if t.size == j - 1
            break
        end
        j += 1
    end
    int << count
end
puts int.sort.shift