s=eval(input())

t=eval(input())

s=list(s)

t=list(t)



size = len(t)

ms = []

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

    # print(s[i:i+size])

    m = sum([a==b for a,b in zip(s[i:i+size], t)])

    ms.append(m)



print((size - max(ms)))
                                                                                                                                                      

                                                                                                                                                       

                                                                                                                                                       

S=list(eval(input()))                                                                                                                                        

T=list(eval(input()))                                                                                                                                        

                                                                                                                                                       

T_size = len(T)                                                                                                                                        

                                                                                                                                                       

def match_num(x):                                                                                                                                      

    return T_size - sum([1 for a,t in zip(x, T) if a==t])                                                                                              

                                                                                                                                                       

b=[]                                                                                                                                                   

for i in range(len(S)-T_size+1):                                                                                                                       

    b.append(match_num(S[i:i+T_size]))                                                                                                                 

                                                                                                                                                       

print((min(b)))
s = eval(input())
t = eval(input())
s = list(s)
t = list(t)
size = len(t)
ms = []
for i in range(len(s) - size + 1):
    # print(s[i:i+size])
    m = sum([a == b for a, b in zip(s[i : i + size], t)])
    ms.append(m)
print((size - max(ms)))

S = list(eval(input()))
T = list(eval(input()))
T_size = len(T)


def match_num(x):
    return T_size - sum([1 for a, t in zip(x, T) if a == t])


b = []
for i in range(len(S) - T_size + 1):
    b.append(match_num(S[i : i + T_size]))
print((min(b)))

-s = eval(input()) -t = eval(input()) -s = list(s) -t = list(t) -size = len(t) -ms = [] -for i in range(len(s) - size + 1): -    # print(s[i:i+size]) -    m = sum([a == b for a, b in zip(s[i : i + size], t)]) -    ms.append(m) -print((size - max(ms))) +S = list(eval(input())) +T = list(eval(input())) +T_size = len(T) + + +def match_num(x): +    return T_size - sum([1 for a, t in zip(x, T) if a == t]) + + +b = [] +for i in range(len(S) - T_size + 1): +    b.append(match_num(S[i : i + T_size])) +print((min(b)))