s=eval(input())

t=eval(input())

len_t = len(t)

ans=len_t

change=0

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

    ss=s[i:i+len_t]

    for j in range(len_t):

        if ss[j] != t[j]:

            change += 1

    ans=min(ans,change)

    change=0

print(ans)
def main():

    s=eval(input())

    t=eval(input())

    len_t=len(t)

    ans = len_t

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

        c = 0

        for j in range(len_t):

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

                c += 1

        ans = min(ans, c)

    print(ans)

    

if __name__ == "__main__":

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

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


if __name__ == "__main__":
    main()

-s = eval(input()) -t = eval(input()) -len_t = len(t) -ans = len_t -change = 0 -for i in range(len(s) - len_t + 1): -    ss = s[i : i + len_t] -    for j in range(len_t): -        if ss[j] != t[j]: -            change += 1 -    ans = min(ans, change) -    change = 0 -print(ans) +def main(): +    s = eval(input()) +    t = eval(input()) +    len_t = len(t) +    ans = len_t +    for i in range(len(s) - len_t + 1): +        c = 0 +        for j in range(len_t): +            if s[i + j] != t[j]: +                c += 1 +        ans = min(ans, c) +    print(ans) + + +if __name__ == "__main__": +    main()