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 = input()
t = input()
ans = float('inf')
for i in range(len(s) - len(t) + 1) :
    ct = 0
    for j in range(len(t)) :
        if t[j] != s[i + j] :
            ct += 1
    ans = min(ans, ct)
print(ans)

Solution (Python):
import sys
input = sys.stdin.buffer.readline




def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return float(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))



def main():
	s=RD()
	t=RD()


	ans=10**6
	

	ns=len(s)
	nt=len(t)
	k=ns-nt

	for i in range(k+1):
		cnt=0
		for j in range(nt):
			if s[i+j]!=t[j]:
				cnt+=1
		ans=min(ans,cnt)

	print(ans)














if __name__ == "__main__":
	main()

Solution (Python):
s=str(input())
t=str(input())
m=len(s)
n=len(t)
ct=n
for i in range (m-n+1):
    z=0
    for j in range(n):
        if s[i+j]!=t[j]:
            z+=1
    if z<ct:
        ct=z
print(ct)

Solution (Python):
S=list(input())
T=list(input())
ans=len(S)
for i in range(len(S)-len(T)+1):
    cnt=len(T)
    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()
s_len = len(s)
t_len = len(t)
ans = float("inf")

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


for i in range(s_len - t_len + 1):
    ans = min(ans, dif_string(s[i:i+t_len], t, t_len))
print(ans)

Solution (Python):
S=input()
T=input()
N=len(S)
M=len(T)
i=0
ans=10**9
while i+M<=N:
    ans=min(ans,sum(s!=t for s,t in zip(S[i:i+M],T)))
    i+=1
print(ans)

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

slen = len(s)
tlen = len(t)

ans = 0
for i in range(slen-tlen+1):
    tmp = s[i:i+tlen]
    count = 0
    for tm, tt in zip(tmp, t):
        if tm == tt:
            count += 1
    ans = max(ans, count)
print(tlen - ans)

Solution (Python):
def resolve():
    S = input()
    T = input()
    sl = len(S)
    tl = len(T)
    mn = 10000
    for i in range(sl - tl+1):
        count = 0
        
        for j,k in zip(T,S[i:i+tl]):
            if j!=k:
                count+=1
        
        mn=min(mn,count)
    print(mn)
resolve()

Solution (Python):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
ceil = math.ceil
s = input()
t = input()
ls = len(s)
lt = len(t)
ans = 10**9
for i in range(0,ls-lt+1):
    
    tmp=0
    for j in range(lt):
        if t[j]!=s[i+j]:
            tmp+=1
    ans =min(ans,tmp)
print(ans)

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

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

Solution (Python):
def solve():
    Ss = input().rstrip()
    Ts = input().rstrip()

    lenS, lenT = len(Ss), len(Ts)

    ans = lenS
    for i in range(lenS-lenT+1):

        num = sum([S != T for S, T in zip(Ss[i:i+lenT], Ts)])
        if num < ans:
            ans = num

    print(ans)


solve()

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


ans = len(t)

for start in range(len(s) - len(t) + 1):
    diff = sum(ch1 != ch2 for ch1, ch2 in zip(t, s[start: start + len(t)]))
    ans = min(ans, diff)
print(ans)

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

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

len_t = len(t)

dif = 1001
for i in range(len(s)-len_t+1):
    dif = min(dif, sum([x !=  y for x, y in zip(s[i:i+len_t], t)]))

print(dif)

Solution (Python):





def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

def str_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return np.array(x)

def int_map():
    return map(int,input().split())

def int_list():
    return list(map(int,input().split()))

def print_space(l):
    return print(" ".join([str(x) for x in l]))


import numpy as np
import collections as col


S = input()
T = input()

a = len(T)

b = []

for i in range(0,len(S)-a+1):
    b.append(S[i:i+a])

ans = 10000

for i in range(0,len(S)-a+1):
    aa = 0
    for j in range(0,a):
        if not b[i][j] == T[j]:
            aa += 1
    ans = min(ans,aa)

print(ans)

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

n = lenS-lenT+1
ans = []

for i in range(n):
  c = 0
  for j in range(lenT):
    if S[j+i] != T[j]:
      c += 1
  ans.append(c)

print(min(ans))

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod=10**9+7


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

print(len(t)-ans)

Solution (Python):
S = input()
T = input()
ans = 999999
for start in range(len(S)-len(T)+1):
    temp = 0
    for n,t in enumerate(T):
        if S[n+start] != t:
            temp += 1
    ans = min(temp,ans)
print(ans)

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

l=len(s)
ll=len(t)
count=10000
for i in range(l-ll+1):
    v=0
    for j in range(ll):
        
        if s[i+j]!=t[j]:
            v=v+1

        if j==ll-1:
            count=min(count,v)
print(count)

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

lendif = len(s) - len(t)

min_global = len(s)

for i in range(lendif + 1):
  beg = i
  end = i + len(t)
  sl = s[beg:end]
  m = 0
  for j in range(len(t)):
    if t[j] != sl[j]:
      m += 1
  if m < min_global:
    min_global = m

print(min_global)

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

ans = 100000

n = len(s)
m = len(t)

for i in range(n - m + 1):
    temp = s[i:i + m]
    count = 0
    for a, b in zip(temp, t):
        if a != b:
            count += 1
    ans = min(count, ans)

print(ans)

Solution (Python):







def fun(s,t):
    ans=0
    for i in range(len(t)):
        if s[i]!=t[i]:
           ans+=1
    return ans       


s=input()
t=input()        
m=len(t)
for i in range(0,len(s)-len(t)+1):
   
     m=min(m,fun(s[i:i+len(t)],t))
    
     if m==0:
         break

print(m)

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

ans = 1000

for i in range(len(s)-len(t)+1):
  count = 0
  for j in range(len(t)):
    if t[j] != s[i+j]:
      count += 1
      
  ans = min(ans, count)
  
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 += 1
  ans = min(ans, cnt)
print (ans)

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

Solution (Python):
import os
import heapq
import sys,threading
import math
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10**5)
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]

def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)

def main():
    
    t=1
    for _ in range(t):

        mn=input()
        s=input()
        n=len(s)
        ans=10**10
        for i in range(len(mn)-n+1):
            
            temp=0
            for j in range(n):
                if s[j]!=mn[i+j]:
                    temp+=1
            ans=min(ans,temp)
        print(ans)



BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Solution (Python):
s = input()
t = input()
ans = float('Inf')
for i in range(len(s) - len(t) + 1):
    num = 0
    for j in range(len(t)):
        if t[j] != s[i + j]:
            num += 1
    ans = min(ans, num)
print(ans)

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

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

ans = []
for i in range(len(s) - len(t) + 1):
    ans.append(sum([x != y for x, y in zip(s[i:i + len(s)], t)]))

print(min(ans))

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

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    s = input()[:-1]
    t = input()[:-1]
    
    ans = 0
    for i in range(len(s)-len(t)+1):
        sub = 0
        for j in range(len(t)):
            if s[i+j] == t[j]:
                sub += 1
        if ans < sub:
            ans = sub
        
    ans = len(t) - ans
    print(ans)
    
    
    
if __name__ == "__main__":
    main()

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

ans = len(t)
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
  ans = min(tmp,ans)
  
print(ans)

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

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()

s = input()
t = input()

len_s = len(s)
len_t = len(t)

for i in range(len_s - len_t + 1):
    s1 = s[i:i+len_t]
    cur = 0
    for j in range(len_t):
        if s1[j] == t[j]:
            cur += 1

    if i == 0:
        max_ = cur
    else:
        max_ = max(cur,max_)
out = len_t - max_
print(out)

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

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

print(len(T)-max_count)

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

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

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

if __name__ == "__main__":
    resolve()

Solution (Python):
s=input()
t=input()
a=0
for i in range(len(s)-len(t)+1):
  c=0
  for j,d in enumerate(t):
    if s[i+j]==d: c+=1
  a=max(a,c)
print(len(t)-a)

Solution (Python):
ans=10**8
s=input()
t=input()

end=False
for i in range(len(s)):
    cnt=0
    for q in range(len(t)):
        if i+q==len(s):
            end=True
            break
        if s[i+q]!=t[q]:
            cnt+=1
            
    if end:
        break
    
    ans=min(ans,cnt)
print(ans)

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = input()
T = input()

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

print(ans)

Solution (Python):
def main():
    s = input()
    t = input()
    n = len(t)
    ans = 0

    for i in range(len(s) - n + 1):
        cnt = 0
        for a, b in zip(s[i:i + n], t):
            if a == b: cnt += 1
        ans = max(ans, cnt)
    print(n - ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
import copy
import heapq
import random
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter




input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n - k])) % MOD


def fact_and_inv(SIZE):
    inv = [0] * SIZE  
    fac = [0] * SIZE  
    finv = [0] * SIZE  
    inv[1] = 1
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    for i in range(2, SIZE):
        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD
        fac[i] = fac[i - 1] * i % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

    return fac, finv


def renritsu(A, Y):
    
    
    
    A = np.matrix(A)
    Y = np.matrix(Y)
    Y = np.reshape(Y, (-1, 1))
    X = np.linalg.solve(A, Y)

    
    return X.flatten().tolist()[0]


class TwoDimGrid:
    
    def __init__(self, h, w, wall="
        self.h = h
        self.w = w
        self.size = (h + 2) * (w + 2)
        self.wall = wall
        self.get_grid()
        

    def get_grid(self):
        grid = [self.wall * (self.w + 2)]
        for i in range(self.h):
            grid.append(self.wall + getS() + self.wall)

        grid.append(self.wall * (self.w + 2))
        self.grid = grid

    def init_cost(self):
        self.cost = [INF] * self.size

    def pos(self, x, y):
        
        return y * (self.w + 2) + x

    def getgrid(self, x, y):
        return self.grid[y][x]

    def get(self, x, y):
        return self.cost[self.pos(x, y)]

    def set(self, x, y, v):
        self.cost[self.pos(x, y)] = v
        return

    def show(self):
        for i in range(self.h + 2):
            print(self.cost[(self.w + 2) * i:(self.w + 2) * (i + 1)])

    def showsome(self, tgt):
        for t in tgt:
            print(t)
        return

    def showsomejoin(self, tgt):
        for t in tgt:
            print("".join(t))
        return

    def search(self):
        grid = self.grid
        move = [(0, 1), (0, -1), (1, 0), (-1, 0)]
        move_eight = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
        
        
        
        
        


def solve():
    s = getS()
    t = getS()

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

    ans = INF
    for i in range(ls - lt+1):
        tgt = s[i:i+lt]
        
        tmp = 0
        for c, d in zip(tgt, t):
            if c != d:
                tmp += 1

        ans = min(ans, tmp)
    print(ans)

if __name__ == "__main__":
    
    solve()

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

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):
def distance(s, t):
    return len([1 for (a, b) in zip(s, t) if a != b])

S = input()
T = input()
ans = float('inf')
for i in range(len(S) - len(T) + 1):
    ans = min(ans, distance(T, S[i:i+len(T)]))
print(ans)

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

Solution (Python):
def main():
    S = input()
    T = input()
    max_cnt = 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
        max_cnt = max(max_cnt, cnt)
    return len(T) - max_cnt

if __name__ == '__main__':
    print(main())

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

minCount = len(t)
l = len(s) - len(t) + 1
for i in range(l):
    count = 0
    for n in range(len(t)):
        if s[i+n] != t[n]:
            count+=1
    if count < minCount:
        minCount = count
print(minCount)

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

n_s = len(S)
n_t = len(T)

MaxScore = 0

for i in range(n_t-n_s+1):
    tempT = T[i:i+n_s]
    score = 0
    for j in range(n_s):
        if S[j] == tempT[j]:
            score += 1
    MaxScore = max(score,MaxScore)

print(n_s-MaxScore)

Solution (Python):
S = input()
T = input()
itch = 0
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
    itch = max(tmp, itch)
    tmp = 0
print(len(T)-itch)

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

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

print(ans)

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

N = len(T)
ans = N

for i in range(len(S) - N + 1):
    s = S[i:i+N]
    count = 0
    for j in range(N):
        if s[j] == T[j]:
            pass
        else:
            count += 1
    if ans > count:
        ans = count

print(ans)

Solution (Python):
s = input()
t = input()
temp = 0
for i in range(len(s)-len(t)+1):
  ns = s[i:i+len(t)]
  cnt = 0
  for k,l in zip(ns,t):
    if k==l:
      cnt += 1
  temp = max(cnt,temp)
print(len(t)-temp)

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

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

ans = 10 ** 5

sl = len(S)
tl = len(T)

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

print(ans)

Solution (Python):
INF=float('inf')
s=input()
t=input()
ls=len(s)
lt=len(t)
S=[]
T=[]
for i in range(ls):
  S.append(s[i])
for j in range(lt):
  T.append(t[j])
ans=INF
for k in range(ls-lt+1):
  cnt=0
  for j in range(lt):
    if S[k+j]!=T[j]:
      cnt+=1
  ans=min(ans,cnt)
  
print(ans)

Solution (Python):








def solve(S, T):
    ans = 10000
    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(ans, tmp)
    print(ans)


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

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

if __name__ == "__main__":
    main()

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
from heapq import heapify, heappop, heappush
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7





S = input()
s_n = len(S)
T = input()
t_n = len(T)

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

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

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

    ans = min(c, ans)

print(ans)

Solution (Python):
s = input()
t = input()
lt = len(t)
ans = lt
for i in range(len(s) - lt + 1):
  cnt = 0
  for j,k in zip(s[i:i + lt], t):
    if j != k:
      cnt += 1
      
  ans = min(ans, cnt)
print(ans)

Solution (Python):
import sys
read = sys.stdin.readline
import time
from heapq import heappush, heappop, heapify
import math
import itertools as it
from collections import deque 


def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
start_time = time.perf_counter()


s = input()
t = input()
mx = 0
for i in range(len(s)-len(t)+1):
    tp = 0
    for j in range(len(t)):        
        if s[i+j] == t[j]:
            tp += 1
    mx = max(mx, tp)
print(len(t)-mx)


end_time = time.perf_counter()
print('time:', end_time-start_time, file=sys.stderr)

Solution (Python):
s = input()
t = input()
n, m = len(s), len(t)

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

print(m - ans)

Solution (Python):
S=input()
T=input()
N=len(S)
M=len(T)
ans=set()
for x in range(N-M+1):
  count=M
  for i in range(M):
    if S[x+i]==T[i]:
      count-=1
  ans.add(count)
print(min(ans))

Solution (Python):

"""
@author: H_Hoshigi
"""
def main():
    S = input()
    T = input()

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

if __name__ == "__main__":
    main()

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

    d = len(S) - len(T)
    t = len(T)
    ans = len(T)
    for s in range(d+1):
        x = len([1 for i in range(t) if S[s+i] != T[i]])
        ans = min(ans, x)
    print(ans)

if __name__ == '__main__':
    main()

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

result = float('inf')
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
    result = min(result, c)
print(result)

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

n=len(s)
m=len(t)
ans=m

for i in range(n-m+1):
    cnt=m
    for j in range(m):
        if s[i+j]==t[j]:
            cnt-=1
    
    ans=min(ans,cnt)

print(ans)

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

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

cnt = 0
maxCnt = 0

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

print(len(T) - maxCnt)

Solution (Python):
s=input()
t=input()
n1=len(s)
n2=len(t)
m=1000
for i in range(n1-n2+1):
    x=s[i:i+n2]
    c=0
    for j in range(n2):
        if x[j]!=t[j]:
            c=c+1
    m=min(m,c)
print(m)

Solution (Python):
S = list(input())
T = list(input())
S_l = len(S)
T_l = len(T)
ans = 10**9
for i in range(S_l - T_l  + 1):
    c = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            c += 1
    ans = min(ans, c)
print(ans)

Solution (Python):
s = input()
t = input()
ans = float('inf')
for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        if t[j] != s[i+j]:
            cnt += 1
    ans = min(ans, cnt)

print(ans)

Solution (Python):
def main():
    s = input()
    t = input()
    slen = len(s)
    tlen = len(t)

    maxlen = 0
    for i in range(slen):
        curlen = 0
        for j in range(tlen):
            if i+j >= slen:
                curlen = -1
                break
            if s[i+j] == t[j]:
                curlen += 1
        maxlen = max(maxlen, curlen)
    print(tlen-maxlen)


main()

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

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

ans = len(t)
n_1 = len(s) - len(t)
n_2 = len(t)

tmp = 0
for i in range(n_1 + 1):
  tmp = 0
  for j in range(n_2):
    if s[i + j] != t[j]:
      tmp += 1
  ans = min(ans, tmp)

print(ans)

Solution (Python):
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 19 + 7
EPS = 10 ** -10

S = list(input())
T = list(input())
N = len(S)
M = len(T)

def check(S, T):
    res = 0
    for i in range(M):
        if S[i] != T[i]:
            res += 1
    return res

ans = INF
for i in range(N-M+1):
    ans = min(ans, check(S[i:i+M], T))
print(ans)

Solution (Python):
s = input()
sn = len(s)
t = input()
tn = len(t)
min_match = tn
for i in range(sn-tn+1):
  count = 0
  for j in range(tn):
    if(s[i+j] != t[j]):
      count += 1
  min_match = min(min_match, count)
print(min_match)

Solution (Python):
S = input()
T = input()
ls = len(S)
lt = len(T)

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

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

SLEN = len(S)
TLEN = len(T)
ans = len(T)
for i in range(SLEN-TLEN+1):
    tmp = 0
    for j in range(TLEN):
        if S[i+j] != T[j]:
            tmp += 1
    if tmp < ans:
        ans = tmp

print(ans)

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

res = 0
for i in range(len(S)-len(T)+1):
  a = 0
  for j in range(len(T)):
    a += S[i+j] == T[j]
  res = max(res,a)
  
print(len(T)-res)

Solution (Python):
S = input()
T = input()
MIS = len(S)
for TS in range(0,len(S)-len(T)+1):
    LS = S[TS:TS+len(T)]
    Count = 0
    for TT in range(0,len(T)):
        if LS[TT]!=T[TT]:
            Count += 1
    MIS = min(MIS,Count)
print(MIS)

Solution (Python):
S = input()
T = input()
N = len(S)
M = len(T)

ans = 0
for i in range(N-M+1):
  tmp = 0
  for j in range(M):
    if i + j >= N:
      break
    if S[i+j] == T[j]:
      tmp += 1
  ans = max(ans,tmp)
print(M- ans)

Solution (Python):
S = input()
T = input()
len_T = len(T)
m = max(sum([1 for s, t in zip(S[i:i+len_T], T) if s == t]) for i in range((len(S) - len_T) + 1))
print(len_T - m)