s = eval(input())

t = eval(input())

ans = len(t)

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

    cnt = 0

    for j in range(len(t)):

        if s[i+j] != t[j]:

            cnt += 1

    ans = min(cnt,ans)

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

t = eval(input())



def getCommonCharNum(x, y):

    commonCharNum = 0

    for i in range(len(x)):

        if x[i] == y[i]:

            commonCharNum += 1

    return commonCharNum

maxCommonNum = 0

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

    tmpCommonCharNum = getCommonCharNum(s[i: len(t) + i], t)  #s[0, len(s)] → s[0 + last_i, len(s) + last_i]

    if maxCommonNum < tmpCommonCharNum:

        maxCommonNum = tmpCommonCharNum

print((len(t) - maxCommonNum))







s = eval(input())
t = eval(input())
ans = len(t)
for i in range(1 + len(s) - len(t)):
    cnt = 0
    for j in range(len(t)):
        if s[i + j] != t[j]:
            cnt += 1
    ans = min(cnt, ans)
print(ans)

s = eval(input())
t = eval(input())


def getCommonCharNum(x, y):
    commonCharNum = 0
    for i in range(len(x)):
        if x[i] == y[i]:
            commonCharNum += 1
    return commonCharNum


maxCommonNum = 0
for i in range(len(s) - len(t) + 1):
    tmpCommonCharNum = getCommonCharNum(
        s[i : len(t) + i], t
    )  # s[0, len(s)] → s[0 + last_i, len(s) + last_i]
    if maxCommonNum < tmpCommonCharNum:
        maxCommonNum = tmpCommonCharNum
print((len(t) - maxCommonNum))

-ans = len(t) -for i in range(1 + len(s) - len(t)): -    cnt = 0 -    for j in range(len(t)): -        if s[i + j] != t[j]: -            cnt += 1 -    ans = min(cnt, ans) -print(ans) + + +def getCommonCharNum(x, y): +    commonCharNum = 0 +    for i in range(len(x)): +        if x[i] == y[i]: +            commonCharNum += 1 +    return commonCharNum + + +maxCommonNum = 0 +for i in range(len(s) - len(t) + 1): +    tmpCommonCharNum = getCommonCharNum( +        s[i : len(t) + i], t +    )  # s[0, len(s)] → s[0 + last_i, len(s) + last_i] +    if maxCommonNum < tmpCommonCharNum: +        maxCommonNum = tmpCommonCharNum +print((len(t) - maxCommonNum))