import sys



S = sys.stdin.readline().strip()

T = sys.stdin.readline().strip()



ls = len(S)

lt = len(T)

match = 0

for i in range(ls - lt + 1):

    tmp = 0

    for j in range(lt):

        if S[i+j] == T[j]:

            tmp += 1

    match = max(match, tmp)



print((lt - match))
import sys



input = sys.stdin.readline

S = input().strip()

T = input().strip()



ans = float("inf")

ls = len(S)

lt = len(T)

for i in range(ls - lt + 1):

    tmp = 0

    for j in range(lt):

        if S[i+j] != T[j]:

            tmp += 1

    ans = min(ans, tmp)



print(ans)
import sys

S = sys.stdin.readline().strip()
T = sys.stdin.readline().strip()
ls = len(S)
lt = len(T)
match = 0
for i in range(ls - lt + 1):
    tmp = 0
    for j in range(lt):
        if S[i + j] == T[j]:
            tmp += 1
    match = max(match, tmp)
print((lt - match))

import sys

input = sys.stdin.readline
S = input().strip()
T = input().strip()
ans = float("inf")
ls = len(S)
lt = len(T)
for i in range(ls - lt + 1):
    tmp = 0
    for j in range(lt):
        if S[i + j] != T[j]:
            tmp += 1
    ans = min(ans, tmp)
print(ans)

-S = sys.stdin.readline().strip() -T = sys.stdin.readline().strip() +input = sys.stdin.readline +S = input().strip() +T = input().strip() +ans = float("inf") -match = 0 -        if S[i + j] == T[j]: +        if S[i + j] != T[j]: -    match = max(match, tmp) -print((lt - match)) +    ans = min(ans, tmp) +print(ans)