s = eval(input())

t = eval(input())

n = len(s)

m = len(t)

max_cnt = 0

for i in range(n - m + 1):

    cnt = 0

    u = s[i:i + m]

    for j in range(m):

        if t[j] == u[j]:

            cnt += 1

    max_cnt = max(max_cnt, cnt)

print((m - max_cnt))
s, t = eval(input()), eval(input())

n, m = len(s), len(t)

print((min(sum(t[j] != s[i + j] for j in range(m)) for i in range(n - m + 1))))
s = eval(input())
t = eval(input())
n = len(s)
m = len(t)
max_cnt = 0
for i in range(n - m + 1):
    cnt = 0
    u = s[i : i + m]
    for j in range(m):
        if t[j] == u[j]:
            cnt += 1
    max_cnt = max(max_cnt, cnt)
print((m - max_cnt))

s, t = eval(input()), eval(input())
n, m = len(s), len(t)
print((min(sum(t[j] != s[i + j] for j in range(m)) for i in range(n - m + 1))))

-s = eval(input()) -t = eval(input()) -n = len(s) -m = len(t) -max_cnt = 0 -for i in range(n - m + 1): -    cnt = 0 -    u = s[i : i + m] -    for j in range(m): -        if t[j] == u[j]: -            cnt += 1 -    max_cnt = max(max_cnt, cnt) -print((m - max_cnt)) +s, t = eval(input()), eval(input()) +n, m = len(s), len(t) +print((min(sum(t[j] != s[i + j] for j in range(m)) for i in range(n - m + 1))))