S=eval(input())

T=eval(input())



N_max = len(T)

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

  score=0

  for j in range(len(T)):

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

      score += 1

      

  N_max = min(score, N_max)

  

print(N_max)
s=eval(input())

t=eval(input())

scorelist=[]

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

  S=s[i:i+len(t)]

  score=0

  for j in range(len(t)):

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

      score+=1

  scorelist.append(str(score))

point=min(scorelist)

print(point)

S = eval(input())
T = eval(input())
N_max = len(T)
for i in range(len(S) - len(T) + 1):
    score = 0
    for j in range(len(T)):
        if S[i + j] != T[j]:
            score += 1
    N_max = min(score, N_max)
print(N_max)

s = eval(input())
t = eval(input())
scorelist = []
for i in range(len(s) - len(t) + 1):
    S = s[i : i + len(t)]
    score = 0
    for j in range(len(t)):
        if S[j] != t[j]:
            score += 1
    scorelist.append(str(score))
point = min(scorelist)
print(point)

-S = eval(input()) -T = eval(input()) -N_max = len(T) -for i in range(len(S) - len(T) + 1): +s = eval(input()) +t = eval(input()) +scorelist = [] +for i in range(len(s) - len(t) + 1): +    S = s[i : i + len(t)] -    for j in range(len(T)): -        if S[i + j] != T[j]: +    for j in range(len(t)): +        if S[j] != t[j]: -    N_max = min(score, N_max) -print(N_max) +    scorelist.append(str(score)) +point = min(scorelist) +print(point)