import sys

input = sys.stdin.readline

S = input().strip()

T = input().strip()

score_list = []

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

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

  score = 0

  for i in range(len(s)):

    if s[i] != T[i]:

      score += 1

  score_list.append(score)

print((min(score_list)))
S = eval(input())

T = eval(input())

ans = 999999

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

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

  score = 0

  for i in range(len(s)):

    if s[i] != T[i]:

      score += 1

  ans = min(ans, score)



print(ans)

import sys

input = sys.stdin.readline
S = input().strip()
T = input().strip()
score_list = []
for i in range(len(S) - len(T) + 1):
    s = S[i : i + len(T)]
    score = 0
    for i in range(len(s)):
        if s[i] != T[i]:
            score += 1
    score_list.append(score)
print((min(score_list)))

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

-import sys - -input = sys.stdin.readline -S = input().strip() -T = input().strip() -score_list = [] +S = eval(input()) +T = eval(input()) +ans = 999999 -    score_list.append(score) -print((min(score_list))) +    ans = min(ans, score) +print(ans)