peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
t = input()
ans = 100000
for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(i,i+len(t)):
        if s[j]!=t[j-i]:
            cnt+=1
    ans = min(ans,cnt)
print(ans)
s=list(input())
t=list(input())
n=len(s)
m=len(t)
ans=10000
for i in range(n-m+1):
    z=0
    for j in range(m):
        if t[j]!=s[i+j]:
            z+=1
    ans=min(ans,z)
print(ans)
s=input()
t=input()
len_s=len(s)
len_t=len(t)
len_n=len_s-len_t
ans=100000
for i in range(0,len_n+1):
    cnt=0
    for j in range(len_t):
        if s[i+j]!=t[j]:
            cnt+=1

    ans=min(ans,cnt)
print(ans)
S = input()
T = input()

ans = 9999
for i in range(len(S)-len(T)+1):
    s = S[i:i+len(T)]
    cnt = 0
    for a,b in zip(s,T):
        if a!=b:
            cnt += 1
    ans = min(ans,cnt)
print(ans)
S =input()
T =input()

answer = len(T)
for i in range(len(S)-len(T)+1):
#	print(S[i:i + len(T)])
	count = 0
	for j in range(len(T)):
		if S[i + j] != T[j]:
			count = count + 1
	if count < answer:
		answer = count
print(answer)
import sys


def main():
    S = sys.stdin.readline().rstrip()
    T = sys.stdin.readline().rstrip()

    ans = len(T)

    for i in range(len(S) - len(T) + 1):
        cnt = 0
        for j in range(len(T)):
            if S[i+j] != T[j]:
                cnt += 1
        ans = min(ans, cnt)

    print(ans)


main()
def check(a,b):
    cnt=0
    for x in range(len(a)):
        if a[x]!=b[x]:
            cnt+=1
    return cnt        
s=input()
t=input()
k=len(t)
ans=k
for x in range(len(s)-len(t)+1):
    ans=min(ans,check(s[x:x+k],t))
print(ans)
S, T = input(), input()

ret = len(T)


# burst force
for st in range(0, len(S)-len(T) + 1):

    diff = 0

    for idx in range(0, len(T)):
        if S[st + idx] != T[idx]:
            diff += 1

    ret = min(ret, diff)

print('{}'.format(ret))
def main():
    s = input()
    t = input()
    n,m = len(s),len(t)
    c = 0
    for i in range(n-m+1):
        cnt = 0
        for j in range(m):
            if s[i+j] == t[j]:
                cnt += 1
        if cnt > c:
            c = cnt
    print(m-c)

if __name__ == "__main__":
    main()
S = input()
T = input()
ans = 1001
for i in range(len(S)-len(T)+1):
	cnt = 0
	a = S[i:i+len(T)]
	for j in range(len(T)):
		if a[j]!=T[j]:
			cnt+=1
	ans = min(ans,cnt)
print(ans)
S = input()
T = input()

len_S = len(S)
len_T = len(T)

ans = 9999



for n in range(len_S - len_T +1):
  part_S = S[n:n+len(T)]
  cnt = 0
  for t in range(len(T)):
    if T[t] != part_S[t]:
      cnt += 1
  if cnt < ans:
    ans = cnt
print(ans)
s = input()
t = input()
max_cover = 0
for i in range(len(s) - len(t) + 1):
    temp_cover = 0
    for j in range(len(t)):
        if s[j + i] == t[j]:
            temp_cover += 1
    max_cover = max(max_cover, temp_cover)
print(len(t) - max_cover)
S = input()
T = input()

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

rec = len(T)
for i in range(len(S)-len(T)+1):
    subst = S[i:i+len(T)]
#    print(subst, matchcount(subst, T))
    rec = min(rec, len(T) - matchcount(subst, T))

print(rec)
s = str(input())
t = str(input())

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

ans = 1001
for i in range(len(s) - len(t) + 1):
    num = 0
    x = s[i : i + len(t)]

    for j in range(len(t)):
        if x[j] != t[j]:
            num += 1

    ans = min(ans, num)

print(ans)
S = input()
T = input()

nt = len(T)
ns = len(S)
ans = 1000

for i in range(ns-nt+1):
  buf = 0
  for j in range(nt):
    if S[i+j]!=T[j]:
      buf += 1
  ans = min(ans, buf)
print(ans)
S = input()
N = len(S)
T = input()
M = len(T)
ans = N
for i in range(N-M+1):
    res = 0
    for j in range(M):
        if S[i+j]!=T[j]:
            res += 1
    ans = min(ans,res)
print(ans)
s = input()
t = input()
T = list(t)
sl = len(s)
tl = len(t)
ans = 10**18

for i in range((sl-tl)+1):
  cnt = 0
  S = list(s[i:i+tl])
  for a,b in zip(S,T):
    if a != b:
      cnt += 1
  if ans > cnt:
    ans = cnt
print(ans)
# -*- coding: utf-8 -*-
# モジュールのインポート
import sys

# 標準入力を取得
S = input()
T = input()

# 求解処理


def get_match_count(s1: str, s2: str) -> int:
    match_count = 0
    for c1, c2 in zip(s1, s2):
        if c1 == c2:
            match_count += 1
    return match_count


N = len(S)
M = len(T)
ans = sys.maxsize
for i in range(N - M + 1):
    ans = min(ans, M - get_match_count(S[i:i + M], T))

# 結果出力
print(ans)
import sys

S = input()
T = input()

result = sys.maxsize

for i in range(len(S)-len(T)+1): 
  tmp = 0
  for j in range(len(T)): 
    if T[j] != S[i+j]: 
      tmp += 1
  if tmp < result: 
    result = tmp
    
print(result)
s = input()
t = input()
count = []
correct = 0
for i in range(len(s) - len(t) + 1):
  for j in range(len(t)):
    if s[i+j] == t[j]:
      correct += 1
  count.append(correct)
  correct = 0
print(len(t) - max(count))
s = input()
t = input()

n_t = len(t)

res = n_t

for i in range(len(s) - n_t +1):
    tmp = s[i:i+n_t]
    count = 0
    for j in range(n_t):
        if tmp[j] != t[j]:
            count +=1
    res = min(res, count)

print(res)
S=list(input())
T=list(input())
#print(S)
#print(T)
con=[0]*len(S)
for i in range(len(S)-len(T)+1):
    #print(i)
    for j in range(len(T)):
        if(S[i+j]==T[j]):
            con[i]=con[i]+1
print(len(T)-max(con))
s=input()
t=input()

count = []

for i in range(len(s)-len(t)+1):
    c=0
    for j in range(i,i+len(t)):
        if s[j] == t[j-i]:
            c+=1
    count.append(c)

# print(count)
print(len(t)-max(count))
def main():
    target = input()
    source = input()
    diff = len(target) - len(source)
    max_change = len(source)
    for i in range(diff+1):
        temp = target[i:len(target)-diff+i]
        change = sum([1 for t, s in zip(temp, source) if(t!=s)])
        if(change < max_change):
            max_change = change
    print(max_change)
if __name__ == '__main__':
    main()
s=input()
t=input()
ans = 0
c = 0
m = 1001

for i in range(len(s)-len(t)+1):
    tmp = s[i:i+len(t)]
    #print(tmp)
    for j in range(len(t)):
        #print(tmp[j],t[j])
        if tmp[j] != t[j]:
            c+=1
        #print(c)
    if m > c:
        m = c
        ans = c
    c=0

print(ans)
S = input()
T = input()

ans = 10**9

for i in range(len(S)-len(T)+1):
	tmpS = S[i:i+len(T)]
	cnt = 0
	for j in range(len(T)):
		if tmpS[j] != T[j]:
			cnt += 1
	ans = min(ans, cnt)
print(ans)
S = input()
T = input()
mx = 0
for i in range(len(S) - len(T) + 1):
    t = 0
    for j in range(len(T)):
        if i + j < len(S) and S[i + j] == T[j]:
            t += 1
    mx = max(mx, t)
print(len(T) - mx)
s = input()
t = input()
ans = len(t)

for i in range(len(s) - len(t)):
    dif = 0
    for j in range(len(t)):
        if t[j] != s[i + j]:
            dif = dif + 1

    ans = min(ans, dif)
print(ans)
S = str(input())
T = str(input())
ans = 1000
for i in range(len(S) - len(T)):
    c = 0
    for j in range(len(T)):
        if S[i] != T[j]:
            c += 1
        i += 1
    ans = min(ans, c)
print(ans)
S = input()
T = input()

max_count = 0
for start in range(len(T)):
    for end in range(start, len(T)):
        if T[start] == S[start]:
            if T[start:end+1] in S[start:-(len(T)-end)]:

                max_count = max(max_count, len(T[start:end+1]))

answer = len(T) - max_count
print(answer)
import sys
input = sys.stdin.readline
S = input()
T = input()
if len(S) - len(T) > 0:
  score_list = []
  for i in range(0, len(S) - len(T) + 1):
    s = S[i:i+len(T)]
    if len(s) != len(T):
      continue
    score = sum([1 if s[i]==T[i] else 0 for i in range(len(s))])
    score_list.append(score)
  print(len(T) - max(score_list))
elif len(S) == len(T):
  score = sum([1 if S[i]==T[i] else 0 for i in range(len(S))])
  print(len(T) - score)
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
S,T = [S() for _ in range(2)]
num = 0
for i in range(len(S)-len(T)):
    str = S[i:i+len(T)]
    count = 0
    for j in range(len(T)):
        if str[j]==T[j]:
            count += 1
        num = max(num,count)
print(len(T)-num)
s=list(str(input()))
t=list(str(input()))
ch=len(t)
for i in range(len(s)-len(t)):
    temp=0
    for j in range(len(t)):
        if(s[i+j]!=t[j]):
            temp+=1
    if(temp<ch):
        ch=temp
print(ch)
S=str(input())
T=str(input())

def longestSubstringFinder(string1, string2):
    answer = ""
    len1, len2 = len(string1), len(string2)
    for i in range(len1):
        match = ""
        for j in range(len2):
            if (i + j < len1 and string1[i + j] == string2[j]):
                match += string2[j]
            else:
                if (len(match) > len(answer)): answer = match
                match = ""
    return answer

print (len(T)-len(longestSubstringFinder(S,T)))
str = input()
part = input()

flg = False

for i in range(len(part)):
  for j in range(i + 1):
    target = str[j: len(str) - (i - j)]
    search = part[j: len(part) - (i - j)]
    # print(f'target {target}, search {search}')
    if search in target:
      print(i)
      flg = True
      break
  
  if flg:
    break

if not flg:
	print(len(part))
S = input()
T = input()
slen = len(S)
tlen = len(T)
ans = 0
for i in range(slen - tlen):
    count = 0
    for j in range(tlen):
        if S[i+j] == T[j]:
            count += 1
    ans = max(ans,count)
print(tlen-ans)
string = input()
sub_string = input()

change = 0

for i in range(0, len(sub_string)):
  if sub_string[i] in string:
    if sub_string[i] != string[i]:
      change += 1
  else: 
    change += 1
  
print(change)
s_long = input()
s_shor = input()

ans = len(s_shor)

strr_1 = s_shor
strr_2 = s_shor

if (strr_1 in s_long):
    print(0)
    exit()

else:
    for i in range(1, len(s_shor)):
        strr_1 = s_shor[: - i]
        strr_2 = s_shor[i:]
    
        if (strr_1 in s_long or strr_2 in s_long):
            ans = min(ans, i)
    
    

print(ans)
def solve():
    s=input()
    t=input()
    ans=len(t)
    for i in range(0,len(s)-len(t)) :
        diff=0
        for j in range(0,len(t)) :
            diff+= 1 if s[i+j]!=t[j] else 0
            if diff>ans :
                break
        ans=min(ans,diff)
    return ans

print(solve())
s = input()
t = input()
l = len(t)

for i in range(l):
    print(t[i:])
    if t[i:] in s:
        a = i
        break
else:
    a = l

for j in range(1, l):
    print(t[:l-j])
    if t[:l-j] in s:
        b = j
        break
else:
    b = l

print(min(a, b))
s=input()
t=input()
for i in range(len(t),0,-1):
    for j in range(0,len(t)-i+1):
        sum=t[j:j+i]
        if sum in s[j:]:
            k=s[j:].find(sum)
            if len(s)-(k+j)>=len(t):
                print(sum,j,k)
                print(len(t)-len(sum))
                exit()
print(len(t))
S = input()
T = input()
counter_dict = {}

for i in range(len(S)):
	counter = 0
	for j in range(len(T)):
		if i + j < len(S):
			if S[i + j] == T[j]:
				counter += 1
	if str(i) in counter_dict.keys():
		if counter_dict[str(i)] < counter:
			counter_dict[str(i)] = counter
	else:
		counter_dict[str(i)] = counter
max_counter = max(counter_dict.values())
print(len(T) - max_counter)
# coding:utf-8
s = input()
t = input()
ans = len(t)

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

print(ans)
S=input()
T=input()

def count_letter(A,B):
  score=0
  for i in range(len(A)):
    if A[i]==B[i]:
      score+=1
  return score

count_max=0
for i in range(len(S)-len(T)):
  count_max=max(count_max,count_letter(S[i:i+len(T)],T))
print(len(T)-count_max)
s = input()
t = input()
n,m = len(s),len(t)
ans = 10**4
for i in range(n-m):
    c = 0
    for j in range(m):
        if t[j] != s[i+j]:
            c += 1
    ans = min(ans,c)
print(ans)
import sys

if __name__ == '__main__':
    S = sys.stdin.readline()
    T = sys.stdin.readline()
    max_match = -1
    for i in range(len(T)):
        for j in range(i+1, len(T)):
            pos = S[i:-j].find(T[i:j])
            if max_match < j-i and pos != -1:
                max_match = j - i
    if max_match == -1:
        l = len(T)
    print(len(T)-max_match-1)
S=list(input())
T=list(input())
x=[0]*(len(S)+1)
for i in range(len(S)):
    for j in range(len(T)):
        if T[j]==S[i] :
            if (j-1)>=0 and (i-1)>=0 and T[j-1]==S[i-1]:
                x[i]=x[i-1]+1
            else:
                x[i]=1
print(len(T)-max(x))
s = input()
t = input()

ls = len(s)
lt = len(t)

ans = 1000000
for i in range(ls - lt):
    tmp = s[i:i+lt]
    score = 0
    for j in range(lt):
        if tmp[j] != t[j]:
            score += 1
    ans = min(ans, score)

print(ans)
S = input()
T = input()

ans1 = len(T)
ans2 = len(T)
for i in range(len(T)):
    if T[0:i+1] in S:
        ans1 = len(T) - i - 1
    if T[::-1][0:i+1][::-1] in S:
        ans2 = len(T) - i - 1 
print(min(ans1, ans2))
s = input()
t = input()
ans = len(t)

for i in range(len(s)):
  if (i + len(t)>= len(s)): break
  dif = 0
  for j in range(len(t)):
    if (s[i + j] != t[j]):
      dif += 1
  ans = min(ans, dif)
print(ans)
S = input()
T = input()
L,l = len(S),len(T)
ans = 1000
for i in range(l,L):
    s = S[i-l:i]
    cnt = 0
    for j in range(l):
        if s[j] != T[j]:
            cnt += 1
    if ans > cnt:
        ans = cnt
print(ans)
s = input()
t = input()


ans = 0
for i in range(len(t)+1, 0, -1):
    for j in range(0, len(t)-i+1):
        if t[j:j+i] in s:
            #print(t[j:j+i], s[j:len(t)-j+i])
            ans = i
            break


print(len(t)-ans)
s=str(input())
t=str(input())

flag=False

m=0

for i in range(len(s)-len(t)+1):
  cnt=0
  for j in range(len(t)):
    #print(s[i+j],t[j])
    if s[i+j]==t[j]:
      cnt+=1
      flag=True
    else:
      if flag==True:
        if m==0 or m<cnt:
          m=cnt
        cnt=0
        flag=False

print(len(t)-m)
def compare(t,s):
  diff=0
  for i in range(len(s)):
    if s[i]!=t[i]:
      diff+=1
  return diff

t = input().strip()
s = input().strip()
smallchange = len(s)
for i in range(len(t)-len(s)+1):
  x = compare(t[i:len(s)+i], s)
  if smallchange > x:
    smallchange = x
 
print(x)
def core(s, t):
  if t in s:
    return 0
  for i in range(1, len(t)):
    for j in range(i+1):
      tempt = t[j:len(t)-i+j]
      temps = s[j:len(s)-i+j]
      if tempt in temps:
        return i
  return len(t)
  
if __name__ == "__main__":
  strings = [input() for i in range(2)]
  print(core(strings[0], strings[1]))
s = input()
t = input()

ans = 10000
len_t = len(t)
for i in range(len(s) - len_t):
    ans_tmp = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            ans_tmp += 1
    ans = min(ans, ans_tmp)
print(ans)
s = input()
t = input()
minCount = 100000000
i = 0
while i < len(s):
    countSame = 0
    j = 0
    while j < len(t) and i+j < len(s):
        if t[j] == s[i+j]:
            countSame += 1
        j += 1
        minCount = min(len(t) - countSame, minCount)
    i += 1
if len(t) == 0:
  print(0)
print(minCount)
s = input()
t = input()
ans = float("inf")
for idx in range(len(s)-len(t)):
    score = 0
    for idx2 in range(len(t)):
        if s[idx+idx2] != t[idx2]:
            score += 1
    ans = min(ans, score)
print(ans)
def main():
    min_num = len(T)
    for i in range(len(S)):
        count = 0
        for j in range(len(T)):
            if i+j > len(S)-1:
                break
            if S[i+j] == T[j]:
                count += 1
        min_num = min_num if min_num < len(T)-count else len(T)-count
    print(min_num)

S = input()
T = input()
main()
S = input()
T = input()

for i in range(len(T), 0, -1):
    for j in range(len(T)-i+1):
        subst = T[j:i+j]
#        print(subst)
        if S.find(subst, j)>=0:
            print (len(T)-i)
            exit(0)
S=str(input())
T=str(input())
min_count=len(T)
for i in range(len(S)-len(T)):
    count=0
    for j in range(len(T)):
        if S[i+j]!=T[j]:
            count+=1
    min_count=min(count,min_count)
print(min_count)
s = str(input())
t = str(input())
ans = 10000
for i in range(len(s) - len(t) + 1) : 
  cnt = 0
  for j in range(len(t)) : 
    if s[i + j] != t[j] : 
      cnt += 1
  ans = min(ans, cnt)
S = input()
T = input()
l = len(T)
ans = l
for i in range(l):
  for j in range(l):
    if (i<=j):
      if T[i:j+1] in S:
        f = S.find(T[i:j+1])
        if f >= i and f + (l-j) <= len(S):
          ans = min(ans, l - (j+1-i))
print(ans)
s = input()
t = input()
N = len(s)
n = len(t)
m = 0
for i in range(N-n):
    cnt = 0
    S = list(s)[i:i+n]
    T = list(t)
    for j in range(n):
        if S[j] == T[j]:
            cnt += 1
    if m < cnt:
        m = cnt
print(n-m)
s=input()
t=input()
ans=float('inf')
for i in range(len(s)-len(t)):
    a=s[i:i+len(t)]
    tans=0
    for i in range(len(t)):
        tans+=(t[i]!=a[i])
    ans=min(ans,tans)
print(ans)
S = input()
T = input()
l = len(T)

mx = -1
for i in range(len(S) - l):
    m = [a == b for a, b in zip(S[i:i + l], T)].count(True)
    mx = max(m, mx)

print(l - mx)
S = input()
T = input()

res = 0
for i in range(len(S)-len(T)):
  a = 0
  for j in range(len(T)):
    a += S[i+j] == T[j]
  res = max(res,a)
  
print(len(T)-res)
S = input()
T = input()
ans=float('inf')
for start in range(len(S) - len(T)):
    ans = min(ans, sum(s != t for s, t in zip(S, T)))
print(ans)
import re
result_list = []
S = input()
T = list(input())
result = 0
for i in range(len(T)+1):
  for j in range(len(T)):
    if i+j<=len(T):
      temp_word = ''.join(T[j:j+i])
      if temp_word in S:
        result = len(T) - len(temp_word)
print(result)
S = input()
T = input()

s = len(S)
t = len(T)

ans = 10**10
for i in range(s-t):
    mm = 0
    for j in range(t):
        if S[i+j]!=T[j]:
            mm += 1
    ans = min(ans,mm)
print(ans)
S = input()
T = input()

ans = len(T)

for i in range(len(T)):
    for j in range(i + 1, len(T) + 1):
        if T[i:j] in S[i:]:
            if len(T) - len(T[i:j]) < ans:
                ans = len(T) - len(T[i:j])

print(ans)
s = input()
t = input()
num = 0
for i in range(len(s) - len(t) + 1):
    # a = s[i:]
    # print(a)
    cnt = 0
    for j in range(len(t)):
        if i + j >= len(t):
            continue
        if t[j] == s[i + j]:
            cnt += 1
    num = max(num, cnt)

print(len(t) - num)
S = input()
T = input()

lenS = len(S)
lenT = len(T)
substrings = [(i, j, T[i: j]) for i in range(lenT) for j in range(i + 1, lenT + 1)]

minv = lenT
for i, j, s in substrings:
    if s in S:
        sidx = S.index(s)
        if (sidx >= i) & (sidx + j - i <= lenS):
            candidate = lenT - (j - i)
            if minv > candidate:
                minv = candidate
print(minv)
S = list(input())
T = list(input())
ls = len(S)
lt = len(T)
ans = lt
for offset in range(ls - lt + 1):
	cnt = 0
	for i in range(lt):
		if S[offset + i] != T[i]:
			cnt += 1
	ans = min(lt, cnt)
print(ans)
s = input()
t = input()
ans = len(t)

for num in range(len(t)):
  if (t[:len(t) - num] in s):
    ans = num
    break
print(num)
def cin():  return list(map(int,input().split()))

S = input()
T = input()

ans = 10 ** 9 + 7
l1 = len(S)
l2 = len(T)
for i in range(l1 - l2):
    cnt = 0
    for j in range(l2):
        if S[i + j] != T[j]:  cnt += 1
    ans = min(ans, cnt)
print(ans)
S = input()
T = input()
ans = len(S)
for i in range(len(T)):
    for j in range(i, len(S)):
        if T[i] == S[j]:
            c = 1
            for k in range(0, min(len(S)-j-1,len(T)-i-1)):
                if T[i+1+k] == S[j+1+k]:
                    c += 1
            tmp = len(T) - c
            ans = min(ans, tmp)
print(ans)
sList = list(input())
tList = list(input())
numList = []
 
for ti,t in enumerate(tList):
  num = 0
  for si,s in enumerate(sList):
    tnum = ti
    snum = si
    while tList[tnum] == sList[snum]:
      num += 1
      tnum += 1
      snum += 1
      if tnum >= len(tList): break
      if snum >= len(sList): break
  numList.append(num)
  if max(numList) > (len(sList) - ti): break

if len(tList) - max(numList) > 0:
  print(len(tList) - max(numList))
else:
  print(0)
S,T = input(),input()
num = len(T)
ans = num
for i in range(num):
    for j in range(i+1,num+1):
        str = T[i:j]
        if str in S[i:-(num-j)]:
            ans = min(ans,num - len((T[i:j])))
        # print(i,j,ans,T[i:j])

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

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    S = input().strip()
    T = input().strip()

    cnt = float("inf")
    for i in range(len(S) - len(T)):
        tmp = 0
        for j in range(len(T)):
            if S[i + j] != T[j]:
                tmp += 1

        cnt = min(cnt, tmp)

    print(cnt)




if __name__ == '__main__':
    main()
a=b=0
for i in range(len(s:=input())-len(t:=input())):
  for j,c in enumerate(t):b+=(s[i+j]==c)
  a=max(a,b);b=0
print(len(t)-a)
s=input()
t=input()
res=float("INF")
for i in range(len(s)):
    for j in range(len(t)):
        if s[i]==t[j] and i>=j and len(s)-i>=len(t)-j :
            tmp=j
            for k in range(j,len(t)):
                if i-j+k<(len(s)) and s[i-j+k] != t[k]:
                    tmp+=1
            res=min(res,tmp)
print(res)
import sys


def check(S, T):
    count = 0
    for s, t in zip(S, T):
        if s != t:
            count += 1
    return count


def main():
    S = input()
    T = input()
    dif = len(S) - len(T)
    ans = 10000
    for i in range(dif):
        compare = S[i: i+len(T)]
        count = check(compare, T)
        if count < ans:
            ans = count

    print(ans)


if __name__ == "__main__":
    main()
S = list(input())
T = list(input())
lt = len(T)

result = 10**5
for i in range(len(S) - len(T) + 1):
    cnt = 0
    for s, t in zip(S[i: (i + lt)], T):
        if s != t:
            cnt += 1
    result = max(cnt, result)
print(result)
s=str(input())
t=str(input())
l=0
for i in range(len(s)-len(t)+1):
    print(s[i:i+len(t)])
    p=0
    for j in range(len(t)):
        if t[j] == s[i:i+len(t)][j]:
            p+=1
    l=max(l,p)
print(len(t)-l)
S = input()
T = input()

ans = len(T)
for i in range(len(S)-len(T)):
  t = 0
  for j in range(len(T)):
    if S[i+j] != T[j]:
      t += 1
  ans = min(ans, t)
print (ans)
S = input()
T = input()
def same(U):
    k = 0
    for i in range(len(U)):
        if U[i] == T[i]:
            k += 1
    return k
ans = 0
for i in range(len(S)-len(T)):
    ans = max(ans,same(S[i:i+len(T)]))
print(len(T)-ans)
import sys
readline = sys.stdin.readline

S = readline().strip()
T = readline().strip()

s = len(S)
t = len(T)
ans = t
for i in range(0, s-t):
  n = t
  for j in range(t):
    if S[i+j] == T[j]:
      n -= 1
  if n < ans:
    ans = n
  if ans == 0:
    break
print(ans)
s, t = input(), input()

ls = len(s)
lt= len(t)
is_double = False

for i in range(0,lt):
  size = lt-i
  for j in range(0,lt-size+1):
    jps = (j+size)
    # 0 j (j+size) lt
    _t = t[j:jps]
    # print(i,j,size,_t, f'\t{s[j:ls-(lt-(j+size))]}')
    if _t in s[j:ls-(lt-(j+size))]:
      is_double = True
      break
  if is_double:
    print(i)
    break

if not is_double:
  print(lt)
s = input()
t = input()

cnt = []
for i in range(len(t)):
    for k in range(i + 1, len(t) + 1):
        if t[i:k] in s[i:]:
            cnt.append(k - i)
        else:
            cnt = [0]
            #print(t[i:k], k - i)
#print(cnt)
print(len(t) - max(cnt))
S = input()
T = input()
ls = len(S)
lt = len(T)
a = 0
for i in range(lt):
    for j in range(i+1,lt+1):
        if T[i:j] in S[i:ls-lt+j]:
            if a < j -i:
                a = j - i
print(lt-a)
s = input()
t = input()

n = len(s)
m = len(t)
ans = m
for i in range(n-m):
  p = 1
  for j in range(i,m):
    if s[i+j] == t[j]: p += 1
    else: break
  if m-p < ans: ans = m-p
print(ans)
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:]+t,t[:-1]))for i in range(len(s))))