s = eval(input())

t = eval(input())

ans = len(t)

for i in range(len(s) - len(t) + 1):

    ans = min(ans, sum(si != ti for si, ti in zip(s[i:], t)))

print(ans)
s,t=eval(input()),eval(input())

print((min(sum(a!=b for a,b in zip(s[i:],t))for i in range(len(s)-len(t)+1))))
s = eval(input())
t = eval(input())
ans = len(t)
for i in range(len(s) - len(t) + 1):
    ans = min(ans, sum(si != ti for si, ti in zip(s[i:], t)))
print(ans)

s, t = eval(input()), eval(input())
print((min(sum(a != b for a, b in zip(s[i:], t)) for i in range(len(s) - len(t) + 1))))

-s = eval(input()) -t = eval(input()) -ans = len(t) -for i in range(len(s) - len(t) + 1): -    ans = min(ans, sum(si != ti for si, ti in zip(s[i:], t))) -print(ans) +s, t = eval(input()), eval(input()) +print((min(sum(a != b for a, b in zip(s[i:], t)) for i in range(len(s) - len(t) + 1))))