Problem:
 Score : 200 points    Problem Statement Given are two strings S and T .  Let us change some of the characters in S so that T will be a substring of S .  At least how many characters do we need to change?  Here, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy , but not a substring of xxyxx .      Constraints  The lengths of S and T are each at least 1 and at most 1000 .  The length of T is at most that of S .  S and T consist of lowercase English letters.         Input Input is given from Standard Input in the following format:  S  T       Output Print the minimum number of characters in S that need to be changed.        Sample Input 1 cabacc
abc      Sample Output 1 1  For example, changing the fourth character a in S to c will match the second through fourth characters in S to T .  Since S itself does not have T as its substring, this number of changes - one - is the minimum needed.       Sample Input 2 codeforces
atcoder      Sample Output 2 6

Solution (Python):

S, T = [input() for x in range(2)]
lenT = len(T)
max_match_len = 0

for i in range(len(S)-lenT+1):
  compareS = S[i:i+lenT]
  match_len = 0
  for j in range(lenT):
    if compareS[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(lenT - max_match_len)

Solution (Python):

S = input()
T = input()

count = 0
max_count = 0

for i in range(len(S) - len(T) +1):
    for j in range(len(T)):
        if S[i+j] == T[j]:
            count += 1
            if max_count <= count:
                max_count = count
        if j == (len(T) -1):
            count = 0

print(len(T) - max_count)

Solution (Python):

S = input()
T = input()

ans = len(T)

for i in range(len(S) - len(T) + 1):
    diff = 0
    for t in range(len(T)):
        if T[t] != S[i + t]:
            diff += 1

    ans = min(ans, diff)

print(ans)

Solution (Python):
S, T = [input() for x in range(2)]
max_match_len = 0

for i in range(len(S)):
  if len(S) - len(T) < i:
    break
  compare_s = S[i:i+len(T)]
  match_len = 0
  for j in range(len(T)):
    if compare_s[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(len(T) - max_match_len)

Solution (Python):
list_data = [input() for _ in range(2)]

s = list_data[0]
t = list_data[1]

len_t = len(t)

max_correct = 0
for i in range(len(s)-len(t)+1):
  correct = 0
  for j in range(len(t)):
    if s[i+j] == t[j]:
      correct += 1
  
  if max_correct < correct:
    max_correct = correct

print(len_t - max_correct)

Solution (Python):
from sys import stdin

S = input()
T = input()

ans  =10000

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

print(ans)

Solution (Python):
s = input()
t = input()
ans = len(t)
c = 0
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
  if ans > c:
    ans = c
print(ans)

Solution (Python):
str = input()
text = input()
ans = len(text)
for i in range(len(str) - len(text) + 1):
    dif = 0
    for j in range(len(text)):
        if not str[i+j] == text[j]:
            dif += 1
    ans = min(ans, dif)
print(ans)

Solution (Python):
S = input()
T = input()

len_s = len(S)
len_t = len(T)

result = len_t
i = 0

while (i <= len_s - len_t):
    diff = 0
    for j, c in enumerate(T):
        if (c != S[i + j]):
            diff += 1
    result = min(result, diff)
    i += 1

print(result)

Solution (Python):
S = input()
T = input()

len_s = len(S)
len_t = len(T)

result = len_t
i = 0

while (i <= len_s - len_t):
    diff = 0
    for j, c in enumerate(T):
        if (c != S[i + j]):
            diff += 1
    
    if (diff < result):
        result = diff

    i += 1

print(result)

Solution (Python):
s = input()
t = input()
s_len = len(s)
t_len = len(t)

ans = 99999

for i in range(-~s_len-t_len):
    cnt = 0
    for j in range(t_len):
        if s[i+j] != t[j]:
            cnt += 1
    ans = min(ans, cnt)

print(ans)

Solution (Python):
S, T = [input() for i in range(2)]
ans = 0

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

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

print(len(T)-ans)

Solution (Python):
s = input()
t = input()
ans = 0
ls = len(s)
lt = len(t)
for i in range(ls-lt+1):
    tmp = 0
    for j in range(lt):
        if s[i+j] == t[j]:
            tmp+=1
    ans = max(ans,tmp)
print(lt-ans)

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

Solution (Python):
S =input()
T = input()
n = len(S)-len(T)+1
count = []

for i in range(n):
  c =0
  for p in range(len(T)):
    if S[i+p] != T[p]:
      c += 1
  count.append(c)
  
print(min(count))

Solution (Python):
s = input()
t = input()
ans = 10**10
l = len(s) - len(t) + 1
for i in range(l):
  tans = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      tans += 1
  ans = min(ans, tans)
print(ans)

Solution (Python):
S = input()
T = input()

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

counter = 10**8
for i in range(s-t+1):
    cnt = 0
    for j in range(t):
        if S[i+j] != T[j]:
            cnt += 1
    if counter > cnt:
        counter = cnt

print(counter)

Solution (Python):
strS = input()
strT = input()

strS = list(strS)
strT = list(strT)

maxRange = 0
l = 0
while l <= (len(strS)-len(strT)):
    m = 0
    count = 0
    while m < (len(strT)):
        if strS[l+m] == strT[m]:
            count += 1
        m += 1
    if maxRange < count:
        maxRange = count
    l += 1

print(len(strT)-maxRange)

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

Solution (Python):
S = input()
T = input()
x,y = len(S),len(T)
A = [0] * (x-y+1)
for i in range(0, x-y+1):
  count = 0
  j = 0
  for k in range(i, i+y):
    if S[k] != T[j]:
      count += 1
    j += 1
  A[i] = count
print(min(A))

Solution (Python):
S=input()
LS=len(S)
T=input()
LT=len(T)

ans=LT
for i in range(LS-LT+1):
  tmp=0
  for j in range(LT):
    if S[i+j]!=T[j]:
      tmp+=1
  
  ans=min(tmp,ans)
  
print(ans)

Solution (Python):
s = input()
t = input()
ans = len(t)


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

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    S = list(input())
    T = list(input())

    t = len(T)
    ans = INF
    for i in range(len(S)):
        s = S[i:i+t]
        if len(s) != t: break

        diff = 0
        for j in range(t):
            diff += s[j] != T[j]
        
        ans = min(ans,diff)

    print(ans)



if __name__ == "__main__":
    main()

Solution (Python):
S = input()
T = input()
ans = 0
for i in range(len(S)):
    cnt = 0
    if (i+len(T)-1)==len(S):
        break
    for j in range(len(T)):
        if T[j]==S[i+j]:
            cnt += 1
    ans = max(ans,cnt)

print(len(T)-ans)

Solution (Python):
s = input()
t = input()
numlist = []
for i in range(len(s)-len(t)+1):
    a = s[i:i+len(t)]
    count = 0
    for j in range(len(t)):
        if a[j] != t[j]:
            count += 1
    numlist.append(count)
print(min(numlist))

Solution (Python):
s = str(input())
t = str(input())
sx = len(s)
tx = len(t)
n = sx - tx + 1
amax = 0
for i in range(n):
  x = 0
  for j in range(tx):
    if s[i+j] == t[j]:
      x += 1
    else:
      pass
  if x > amax:
    amax = x
print(tx - amax)

Solution (Python):
s = input()
t= input()
c=0
an = 10**8
for i in range(len(s)-len(t)+1):
    for j in range(i,i+len(t)):

        if s[j]!=t[j-i]:
            c+=1

    an = min(c,an)
    c=0
print(an)

Solution (Python):
s = input()
t = input()


max = 0
for i in range(len(s) -len(t) + 1):
    target = s[i:i+len(t)]
    matched = 0
    for j in range(len(target)):
        if target[j] == t[j]:
            matched += 1
    if matched > max:
        max = matched

print(len(t) - max)

Solution (Python):
s = input()
t = input()
ans = 10**8
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)

Solution (Python):
s = input()
t = input()

sl = len(s)
tl = len(t)

ans = tl

for i in range(sl):
    if i < sl - tl + 1:
        ss = s[i:i+tl]
        num = 0
        for j in range(tl):
            if ss[j] != t[j]:
                num += 1
        if num < ans:
            ans = num

print(ans)

Solution (Python):
s = input()
t = input()

max_tmp = 0
out = 0


def comp(a, b):
    cnt = 0
    for i in range(len(a)):
        if a[i] == b[i]:
            cnt += 1
    return cnt


for i in range(len(s) - len(t) + 1):
    max_tmp = comp(s[i:i + len(t)], t)
    out = max(out, max_tmp)

print(len(t) - out)

Solution (Python):
s = input()
t = input()

ans = 0
max_match = 0
match = 0
for i in range(len(s) - len(t) + 1):
    for j in range(len(t)):
        if s[i+j] == t[j]:
            match += 1
    else:
        max_match = max(max_match, match)
        match = 0

ans = len(t) - max_match

print(ans)

Solution (Python):
S = input()
T = input()

import math
res = math.inf

from collections import Counter

mt = list(map(ord, list(T)))
for i in range(len(S) - len(T) + 1):
    
    res = min(res, len(T) - Counter([a - b for a, b in zip(map(ord, list(S[i: i + len(T)])), mt)])[0])
print(res)

Solution (Python):
S = list(input())
T = list(input())

mindiff = len(S)
for i in range(len(S) - len(T) +1):
    diff = 0
    for j in range(len(T)):
        if(S[i+j] != T[j]):
            diff += 1
        pass
    if(diff < mindiff):
        mindiff = diff

print(mindiff)

Solution (Python):
S=str(input())
T=str(input())


U=[0]*(len(S)-len(T)+1)
c=[0]*(len(S)-len(T)+1)
for j in range(len(S)-len(T)+1):
    U[j]=S[j:j+len(T)]
    for i in range(len(T)):
        if U[j][i]==T[i] :c[j]=c[j]+1

print(len(T)-max(c))

Solution (Python):
s=input()
t=input()
ans=100000000
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)

Solution (Python):
s = input()
t = input()
min_count = len(s)
for i in range(len(s) - len(t)+1):
    count = 0
    for j in range(len(t)):
        if s[i + j] != t[j]:
            count += 1
    if min_count > count:
        min_count = count
print(min_count)

Solution (Python):
S=input()
T=input()
Slen=len(S)
Tlen=len(T)
ans=5000
for i in range(0,Slen-Tlen+1):
    tans=0
    for j in range(0,Tlen):
        if S[i+j]!=T[j]:
            tans+=1
    if tans<ans:
        ans=tans
print(ans)

Solution (Python):
s=input()
t=input()
a = len(s)
b = len(t)
l = []
for i in range(a-b+1):
    cnt = 0
    c = s[i:i+b]
    for x, y in zip(c, t):
        if x != y:
            cnt +=1
    l.append(cnt)
print(min(l))

Solution (Python):
S = str(input())
T = str(input())
lenS = len(S)
lenT = len(T)
splitS = []

for i in range(lenS - lenT +1):
    tempS = S[i : i+lenT]
    splitS.append(tempS)

answer = lenT
for tempS in splitS:
    count = 0
    for i in range(lenT):
        if tempS[i] != T[i]:
            count += 1
    answer = min(answer, count)
print(answer)

Solution (Python):
S = list(input())
T = list(input())

i = 0
ans =[]

while i + len(T) <= len(S):
    n = 0
    for s, t in zip(S[i:i+len(T)], T):
        if s != t:
            n += 1
    ans.append(n)
    i += 1

print(min(ans))

Solution (Python):
S=input()
T=input()

len_s=len(S)
len_t=len(T)

ans=0
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 = max(ans,cnt)
    
print(len_t-ans)

Solution (Python):
s= input()
t= input()

atmp=2000
for i in range(len(s) - len(t) + 1):
    s1=s[i:i+len(t)]
    
    tmp=0
    for j in range(len(t)):
        if s1[j]!=t[j]:
            tmp+=1
    atmp=min(atmp,tmp)
        
print(atmp)

Solution (Python):
s = input()
t = input()

ans = 2000

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

print(ans)

Solution (Python):
S = input()
T = input()

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

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

Solution (Python):
S = str(input());T = str(input())
N = len(S)
M = len(T)
ans = M
for i in range(N-M+1):
  kouho = S[i:i+M]
  temp = 0
  
  for j in range(M):
    if kouho[j] != T[j]:
      temp += 1
  ans = min(ans,temp)
print(ans)

Solution (Python):
s = input()
t = input()

ans = 10 ** 8
for i in range(len(s)-len(t)+1):
  check = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      check = check + 1
  if ans > check:
    ans = check
print(ans)

Solution (Python):
s, t = [input() for _ in range(2)]
max_count = 0
for i in range(len(s) - len(t) + 1):
    m_count = 0
    for j in range(len(t)):
        if s[i+j] == t[j]:
            m_count += 1
    if max_count < m_count:
        max_count = m_count

print(len(t)-max_count)

Solution (Python):
s, t = [input() for _ in range(2)]
max_count = 0
for i in range(len(s) - len(t) + 1):
    m_count = 0
    for j in range(len(t)):
        if s[i:][j] == t[j]:
            m_count += 1
    if max_count < m_count:
        max_count = m_count

print(len(t)-max_count)

Solution (Python):
s = input()
t = input()
ans = 1000

for idx in range(len(t), len(s)+1):
    tmp = 0
    for s_s, t_s in zip(list(s[idx-len(t):idx]), list(t)):
        if not s_s == t_s:
            tmp += 1
    if ans > tmp:
        ans = tmp

print(ans)

Solution (Python):
S = input()
T = input()

ans = 1000
for start in range(len(S) - len(T) + 1):
  diff = 0
  for i in range(len(T)):
    if not T[i] == S[start + i]:
      diff += 1
  ans = min(ans, diff)
print(ans)

Solution (Python):
s = input()
t = input()

diff = 0
min_diff = len(t)

for cnt_s in range(0, len(s) - len(t)+1):
    diff = 0
    for cnt_t in range(0, len(t)):
        if s[cnt_s + cnt_t] != t[cnt_t]:
            diff += 1
    if min_diff > diff:
        min_diff = diff

print(min_diff)

Solution (Python):

def count(s1,s2):
	cnt = 0
	for i in range(len(s2)):
		if s1[i] != s2[i]:
			cnt += 1
	return cnt 


S1 = input()
S2 = input()

mmin = len(S2)
for i in range(len(S1)-len(S2)+1):
	k = count(S1[i:len(S2)+i],S2)
	if k < mmin:
		mmin = k

print(mmin)

Solution (Python):
S = list(input())
T = list(input())
ans = float("inf")
for i in range(len(S)-len(T)+1):
  n = 0
  for j in range(len(T)):
    if T[j] != S[i+j]:
      n += 1
  ans = min(ans,n)
print(ans)

Solution (Python):
s=list(input())
t=list(input())
ans=[]

for i in range(len(s)-len(t)+1):
    u=s[i:len(t)+i]
    a=0
    for j in range(len(t)):
        if not t[j-1]==u[j-1]:
            a=a+1
    ans.append(a)
print(min(ans))

Solution (Python):
s = input()
t = input()
ans = len(t)

for i in range(len(s) - len(t) +1):
    curr = len(t)
    for j in range(len(t)):
        if s[i+j] == t[j]:
            curr -= 1
    if curr < ans:
        ans = curr

print(ans)

Solution (Python):
S = input()
T = input()

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

ans = 1e10

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

print(ans)

Solution (Python):





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr



def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

inf = 10 ** 18
mod = 10 ** 9 + 7

_INPUT = """\
codeforces
atcoder
"""

def main(*, input=input):
    sr = lambda: input()
    ir = lambda: int(sr())
    lr = lambda: list(map(int, sr().split()))

    s = sr()
    t = sr()
    n = len(s)
    len_t = len(t)
    ans = len_t
    for i in range(n-len_t+1):
        tmp = 0
        for j,c in enumerate(t):
            if s[i+j] != c:
                tmp+=1
        ans = min(ans,tmp)
    print(ans)


if __name__ == "__main__":
    import io, sys

    

    main()

Solution (Python):
s = input()
t = input()
ans = len(t)
for i in range(len(s)):
    if len(t)> len(s)-i:
        break
    else:
        cnt=0
        for j in range(len(t)):
            if s[i+j]==t[j]:
                cnt+=1
    ans=min(ans,len(t)-cnt)
print(ans)

Solution (Python):
def match_len(S, T):
    ls, lt = len(S), len(T)
    ret = 0
    for i in range(ls - lt + 1):
        tmp = 0
        for x, y in zip(S[i:], T):
            tmp += x == y
        ret = tmp if tmp > ret else ret
    return ret

S = input()
T = input()
print(len(T) - match_len(S, T))

Solution (Python):
S = input()
T = input()

ans = 1000000  



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

print(ans)

Solution (Python):
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)

Solution (Python):
s = str(input())
t = str(input())
ans = 1001
for i in range(len(s)-len(t)+1):
    tmp = 0
    for j in range(len(t)):
        if s[i+j] == t[j]:
            tmp += 1
    ans = min(len(t)-tmp,ans)
print(ans)

Solution (Python):
S = list(str(input()))
T = list(str(input()))
i = 0
ans = []
len_s = len(S)
len_t = len(T)
while i < len_s-len_t+1:
    cnt = 0
    for ss, tt in zip(S[i:i+len_t], T):
        if ss != tt:
            cnt += 1
    ans.append(cnt)
    i += 1
print(min(ans))

Solution (Python):
S = input()
T = input()

min_dist = 10**10
for i in range(len(S) - len(T) + 1):
    for k in range(len(T)):
        dist = 0
        for s, t in zip(S[i:i + len(T)], T):
            if s != t:
                dist += 1
            if dist >= min_dist:
                break

        min_dist = min(dist, min_dist)
        if min_dist == 0:
            print(0)
            exit()

print(min_dist)

Solution (Python):
s = input()
t = input()

n = len(s)
m = len(t)
ans = m
for i in range(n-m+1):
  p = 0
  for j in range(m):
    if s[i+j] != t[j]: p += 1
  if p < ans: ans = p
print(ans)

Solution (Python):

S = str(input())
T = str(input())
L = len(S) - len(T) + 1

ansL = []
for i in range(L):
    ans = 0
    for j in range(len(T)):
        if S[j] != T[j]:
            ans += 1
    
    ansL.append(ans)
    S = S[1:]
print(min(ansL))

Solution (Python):
S = list(str(input()))
T = list(str(input()))
s = 0
t = 0
len_s = len(S)
len_t = len(T)
i = 0
ans = []

while i < len_s-len_t+1:
    cnt = 0
    
    for ss, tt in zip(S[i:i+len_t], T):
        
        if ss != tt:
            cnt +=1
    ans.append(cnt)
    i += 1


print(min(ans))

Solution (Python):
S = input()
T = input()
ans = len(T)
for i in range(len(S)-len(T)+1):
  count = 0
  
  for s, t in zip(S[i:i+len(T)], T):
    if s != t:
      count += 1
  ans = min(count, ans)
print(ans)

Solution (Python):

S = input()
T = input()
ans = []
for i in range(0, (len(S)-len(T) + 1)):
    tmp = 0
    
    for j in range(0, len(T)):
        if T[j] != S[i +j]:
            tmp += 1
            
        
    ans.append(tmp)
        
print(min(ans))

Solution (Python):
S, T = [input() for _ in range(2)]

answer = float("inf")

for i in range(len(S) - len(T) + 1):
	k = 0
	S_subset = S[i:i + len(T)]
	for t, s in zip(T, S_subset):
		if t != s:
			k += 1
	answer = min(answer, k)
print(answer)

Solution (Python):











ST = [input() for i in range(2)]
S = ST[0]
T = ST[1]
ans = len(T)

for i in range(len(S) - len(T) + 1):
	count = len(T)
	for j in range(len(T)):
		if(T[j] == S[i + j]):
			count -= 1
	if(ans > count):
		ans = count
print(ans)

Solution (Python):
S, T = [input() for _ in range(2)]
answer = 1001

for i in range(len(S) - len(T) + 1):
	k = 0
	U = S[i:i + len(T)]
	for j in range(len(T)):
		if T[j] != U[j]:
			k += 1
	answer = min(answer, k)
print(answer)

Solution (Python):
s = input()
t = input()

s_len = len(s)
t_len = len(t)

out = t_len

for i in range(0, s_len - t_len + 1):
    diff = 0
    for j in range(0, t_len):
        if t[j] != s[i + j]:
            diff += 1
    out = min(out, diff)

print(out)

Solution (Python):
S = input()
T = input()
ans = [0] * (len(S) - len(T)+1)
for a in range(len(S) - len(T)+1):
    for b in range(len(T)):
        if S[a + b] != T[b]:
            ans[a] += 1

print(min(ans))

Solution (Python):
s = input()
t = input()

ans = 1e+9

for si in range(len(s)):
    if si + len(t) > len(s):
        continue
    cnt = 0
    for ti in range(len(t)):
        if s[si+ti] != t[ti]:
            cnt += 1
    ans = min(ans, cnt)

print(ans)

Solution (Python):
S = input()
T = input()

S = list(S)
T = list(T)

result = len(T)
x = 0

for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if S[i+j] != T[j]:
            x += 1
    if result > x:
        result = x
    x = 0

print(result)

Solution (Python):
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)

Solution (Python):
s = input()
t = input()
ans = len(t)
 
for i in range(len(s)):
  if (i + len(t) - 1 >= 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)

Solution (Python):
s=input()
t=input()
n=len(s)
n1=len(t)  
ans=10**10 
for i in range(n-n1+1):
    diff=0
    for j in range(n1):
        if(t[j]!=s[i+j]):
            diff+=1
    ans=min(ans,diff)
print(ans)

Solution (Python):
s = input()
t = input()
ans = len(t)

for i in range(len(s)):
  if (i + len(t) - 1 >= 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)

Solution (Python):


S = str(input())
T = str(input())

s = len(S)
t = len(T)
ans = 10**18

for i in range(s-t+1):
    tmp = 0
    for j in range(t):
        if S[i+j] == T[j]:
            continue
        else:
            tmp += 1
    ans = min(ans, tmp)

print(ans)

Solution (Python):
def solve():
    S = input()
    T = input()

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

if __name__ == '__main__':
    solve()

Solution (Python):
s = input()
t = input()
ans = len(s)

for i in range(len(s)):
  if (i + len(t) - 1 >= 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)

Solution (Python):
S=input()
T=input()
ans=len(T)
for i in range(len(S)-len(T)+1):
  _ans=0
  for j in range(len(T)):
    if S[i+j]!=T[j]:
      _ans+=1
  ans=min(ans,_ans)
print(ans)

Solution (Python):
S = input()
T = input()

ans = len(T)

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

Solution (Python):
s = input()
t = 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 = cnt + 1
    ans = min(ans,cnt)

print(ans)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S = SS()
    T = SS()
    len_S = len(S)
    len_T = len(T)

    ans = len(T)
    for i in range(len_S - len_T + 1):
        diff = len([(j, k) for j, k in zip(S[i:i+len_T], T) if j != k])
        ans = min(diff, ans)

    print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):

S=input()
T=input()
check=[]
for i in range(len(S)-len(T)+1):
    check.append(0)
    for j,tt in enumerate(T):
        if tt==S[i+j]:
            check[i]+=1

check.append(0)

print(len(T)-max(check))

Solution (Python):
s = list(input())
t = list(input())
length = len(s)-len(t) + 1
max = 0
for i in range(length):
    count = 0
    for j in range(len(t)):
        if t[j] == s[i+j]:
            count += 1
        if j == len(t)-1 and max < count:
            max = count
print(len(t) - max)

Solution (Python):
s = input()
t = input()
ss = len(s)
tt = len(t)
min = tt


for i in range(ss - tt + 1):
  count = 0
  for j in range(tt):
    if s[i+j] != t[j]:
      count += 1
  if min > count:
    min = count

print(min)

Solution (Python):
S=input()
T=input()
match=0
for i in range(len(S)-len(T)+1):
    count=0
    for j in range(len(T)):
        if S[i+j]==T[j]:
            count=count+1
    if match<count:
        match=count
print(len(T)-match)

Solution (Python):
def count(s1, s2):
    dst = 0
    for c1, c2 in zip(s1, s2):
        if c1 != c2: dst+=1

    return dst

def execute(S, T):
    dst = len(T)

    for i in range(len(S) - len(T)+1):
        s = S[i:i+len(T)]
        c = count(s, T)
        if c < dst:
            dst = c

    return dst

if __name__ == '__main__':
    S = input()
    T = input()

    print(execute(S, T))

Solution (Python):
s = input()
t = input()
ans = 1000
c = 0


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

print(ans)

Solution (Python):
s, t = [input() for i in range(2)]
c = []
for i in range(len(s) - len(t) + 1):
  d = len(t)
  for a, b in zip(s[i:], t):
    if a == b:
      d -= 1
  c.append(d)
print(min(c))

Solution (Python):
s=input()
t=input()
print(min(sum(x!=y for x,y in zip(s[i:],t))for i in range(-~len(s)-len(t))))

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    S = input()
    T = input()
    len_s = len(S)
    len_t = len(T)
    ans = 1000
    for i in range(len_s-len_t+1):
        cunt = 0
        for j in range(len_t):
            if S[i+j] != T[j]:
                cunt += 1
        ans = min(ans, cunt)
    print(ans)

if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    S = input()
    T = input()
    len_s = len(S)
    len_t = len(T)
    ans = 1000
    for i in range(len_s-len_t+1):
        cunt = 0
        for j in range(len_t):
            if S[i+j] != T[j]:
                cunt += 1
        ans = min(ans, cunt)
    print(ans)

if __name__=='__main__':
    main()

Solution (Python):
s=input()
t=input()
ls=len(s)
lt=len(t)
ans=lt

for i in range(0,ls-lt+1):
	count = 0
	for j in range(lt):
		if s[i+j]!=t[j]:
			count+=1
	if count<ans:
		ans=count
print(ans)

Solution (Python):
def main(S, T):
    score = float('inf')
    org_length = len(S)
    part_length = len(T)

    for i in range(0, org_length - part_length + 1):
        part_str = S[i:i + part_length]

        count = 0
        for a, b in zip(part_str, T):
            if a != b:
                count+=1
        score = min(count, score)

    print(score)


if __name__ == '__main__':
    S = input()
    T = input()
    main(S, T)

Solution (Python):

s = input()
t = input()

ans = len(t)

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

    ans = min(ans, dif)

print(ans)

Solution (Python):
def comp(a,b):
    s = 0
    for i,j in zip(a,b):
        if not i == j:
            s += 1
    return s
 
s = input()
t = input()
ans = len(t)
 
for i in range(len(s) - len(t) + 1):
    score = comp(s[i:i+len(t)],t)
    if score == 0:
        ans = score
        break
    if ans > score:
        ans = score
 
print(ans)

Solution (Python):
s = input().rstrip()
t = input().rstrip()
l_s = len(s)
l_t = len(t)
ans = l_t
for i in range(l_s-l_t+1):
  tmp_ans = l_t
  for j in range(l_t):
    if t[j] == s[i+j]:
      tmp_ans -= 1
  ans = min(ans, tmp_ans)
print(ans)

Solution (Python):
S=input()
T=input()

max_ans=0
for i in range(len(S)):
  max_n = 0
  for j in range(len(T)):
    if len(S) >= i + len(T):
      if S[i+j]==T[j]:
      	max_n=max_n+1
  
  if max_ans <= max_n:
    max_ans=max_n

print(len(T)-max_ans)

Solution (Python):
def comp(a,b):
    s = 0
    for i,j in zip(a,b):
        if not i == j:
            s += 1
    return s

s = input()
t = input()
ans = len(t)

for i in range(len(s) - len(t) + 1):
    score = comp(s[i:i+len(t)],t)
    if score == 0:
        ans = score
        break
    if ans > score:
        ans = score

print(ans)

Solution (Python):
s=input()
t=input()

count_min = 1000

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

print(count_min)

Solution (Python):
s = input()
t = input()

ans = len(t)

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