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):
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    s = s_input()
    t = s_input()
    l_s = len(s)
    l_t = len(t)
    ans = INF
    for i in range(l_s-l_t+1):
        trial = 0
        r = s[i:]
        for k in range(l_t):
            if t[k] != r[k]:
                trial += 1
        ans = min(ans,trial)
    print(ans)



if __name__=="__main__":
    main()

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


ma=0
for i in range(len(s)):
  cnt=0
  now=s[i:i+len(t)]
  if len(now)!=len(t):
    break


  
  for j in range(len(now)):
    if now[j]==t[j]:
      cnt+=1
  ma=max(cnt,ma)

print(len(t)-ma)

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

for i in range(len(S)):
  if i+len(T)>len(S):
    break
  
  subs=S[i:i+len(T)]
  tmp=0
  for j in range(len(T)):
    tmp=1+tmp if subs[j]!=T[j] else 0+tmp
  ans=min(ans,tmp)
print(ans)

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

s_len =len(s)
t_len =len(t)
count = 0
ans = []



for i in range(s_len - t_len + 1):
    for j in range(t_len):
        if s[i:t_len + i][j] != t[j]:
            count += 1
    ans.append(count)
    count = 0

min_ans = min(ans)
print(min_ans)

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

answer = float('inf')
for s in range(len(S)):
    if len(S) - s < len(T):
        break
    count = 0
    for i in range(len(T)):

        if S[s+i] != T[i]:
            count += 1

    answer = min(answer, count)

print(answer)

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

max_count = 0
for start_t in range(len(T)):
    for start_s in range(start_t, len(S)):
        if len(S) - start_s < len(T) - start_t:
            break
        if T[start_t] == S[start_s]:
            count = 0

            for i in range(len(T) - start_t):
                if T[start_t+i] == S[start_s+i]:
                    count += 1
            
            max_count = max(max_count, count)

answer = len(T) - max_count
print(answer)

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

ans = float('inf')
for i in range(len(S)):
    string = S[i:i + len(T)]
    if len(string) < len(T):
        continue

    score = len([1 for ch_s, ch_t in zip(string, T) if ch_s != ch_t])
    ans = min(ans, score)
print(ans)

Solution (Python):
import re
S=input()
T=input()
ans=10**1000

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):
n_gram = lambda t, n: [t[i:i+n] for i in range(len(t) - n + 1)]

S = input()
T = input()

t_len = len(T)
count = t_len

s_list = n_gram(S, t_len)

for s in s_list:
    c = 0
    for i in range(len(s)):
        if s[i] != T[i]:
            c += 1
    count = min(count, c)

print(count)

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

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

Solution (Python):
S=input()
T=input()
NS=len(S)
NT=len(T)
MAX=0
for i in range(NS-NT+1):
    COUNT=0
    for j in range(NT):
        if S[i+j]==T[j]:
            COUNT+=1
    if COUNT>MAX:
        MAX=COUNT
print(NT-MAX)

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

answer = len(T)

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
  answer = min(answer, diff)

print(answer)

Solution (Python):
s = input()
t = input()
sl = len(s)
tl = len(t)

cnt = 0
ans = 0

for i in range(sl-tl+1):
    for j in range(tl):
        if t[j] == s[i+j]:
            cnt += 1
    
    ans = max(cnt, ans)
    cnt = 0

print(tl - ans)

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

Solution (Python):
s = input()
t = input()
ans = 10**10
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()
n=len(s)
nn=len(t)
k=nn-n
ans=0
for i in range(n-nn+1):
    tmp=0
    for j in range(nn):
        if t[j]==s[i+j]:
            tmp+=1
    if tmp>ans:
        ans=tmp
print(nn-ans)

Solution (Python):
S = input()
T = input()
ans = float('inf')
for i2 in range(len(S)):
    if i2 + len(T) > len(S):
        break
    ans = min(ans, sum(S[i1] != T[i1 - i2] for i1 in range(i2, i2 + len(T))))
print(ans)

Solution (Python):
S = input()
T = input()
s = len(S)
t = len(T)

def checkCommonLength(a: str, b: str) -> int:
    l = len(a)
    count = 0
    for i in range(l):
        if a[i] == b[i]:
            count += 1
    return count

max_val = 0
for i in range(s):
    if i + t <= s:
        testStr = S[i : i + t]
        
        max_val = max(max_val, checkCommonLength(S[i : i + t], T))

print(t - max_val)

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

Solution (Python):
s = input()
t = input()
ans = len(t)
for idx in range(len(s)-len(t)+1):
    score = 0
    for idx2 in range(len(t)):
        if s[idx+idx2] != t[idx2]:
            score += 1
    ans = min(ans, score)
print(ans)

Solution (Python):


s = input()
t = input()

def diff(s, t):
    return sum(1 for i, c in enumerate(s) if c != t[i])

m = min(diff(s[i:i + len(t)], t) for i in range(len(s) - len(t) + 1))
print(m)

Solution (Python):
s = list(input())
t = list(input())
mm = 0
min = len(t)
for i in range(len(s)-len(t)+1):
    sp = s[i:len(t)+i]
    for k in range(len(t)):
        if sp[k] != t[k]:
            mm += 1
    if min > mm:
        min = mm
    mm = 0
print(min)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def input(): return sys.stdin.readline().rstrip()

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

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

if __name__ == '__main__':
    main()

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

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

print(ans)

Solution (Python):
s = input()
t = input()
slen = len(s)
tlen = len(t)
ans = 10**20
temp = 0

for start in range(0,slen-tlen+1):
    temp = 0
    for i in range(0,tlen):
        if t[i] != s[start+i]:
            temp += 1
    ans = min(ans,temp)
print(ans)

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

Solution (Python):
S = input()
T = input()
lenS = len(S)
lenT = len(T)
minlength = 1000
for l_S in range(lenS - lenT + 1):
    cnt = 0
    for w in range(lenT):
        if S[l_S+w] != T[w]:
            cnt += 1
    minlength = min(minlength, cnt)
print(minlength)

Solution (Python):
from collections import deque
import sys, copy, itertools,heapq

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



print(ans)

Solution (Python):
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+1):
        compare = S[i: i+len(T)]
        count = check(compare, T)
        if count < ans:
            ans = count

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
s,t=input(),input()
print(min(sum(c!=d for c,d in zip(s[i:],t)) for i in range(len(s)-len(t)+1)))

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

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

s = input()
t = input()

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

Solution (Python):


S = input()
T = input()

if len(T) > len(S) or len(S) == 0:
    print(0)

answer = float("inf")
for i in range(len(S) - len(T) + 1):

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

    unique = 0
    for s,o in zip(sub, T):
        if s != o:
            unique += 1
    
    answer = min(answer, unique)

print(answer)

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
s = input()
t = input()
start, end = 0, len(t)
def f(s, t, start, end):
    min_changes = len(t)
    count = 0
    for i in range(len(t)):
        if s[start:end][i] != t[i]: count += 1
    if start + len(t) == len(s): return min(count, min_changes)
    else: return min(count, f(s, t, start+1, end+1))

print(f(s, t, start, end))

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

ans = 10**18
for l in range(len(S) - len(T) + 1):
    cnt = 0
    for s, t in zip(S[l:], T):
        if s != t:
            cnt += 1
    ans = min(ans, cnt)

print(ans)

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

z = len(S)-len(T)

res = []
cnt = 0
if z == 0:
  for a,b in zip(S,T):
    if a != b:
      cnt += 1
  print(cnt)
  exit();
else:
  for i in range(z):
    s = S[i:i+len(T)]
    cnt = 0
    for j,k in zip(s,T):
      if j != k:
        cnt += 1
    res.append(cnt)
  print(min(res))

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

Slen = len(S)
Tlen = len(T)
diff = Slen - Tlen

ans = [0] * (diff+1)
for i in range(diff+1):
	S_i = i
	for j in range(Tlen):
		if S[S_i] != T[j]:
			ans[i] = ans[i] + 1
		S_i += 1
min_ans = min(ans)
print(min_ans)

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

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

print(answer)

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

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

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

Solution (Python):

import sys

def main():
    input = sys.stdin.readline
    s = input().rstrip()
    t = input().rstrip()
    
    ans = float("INF")
    for start in range(len(s) - len(t) + 1):
        cnt = 0
        for char in range(len(t)):
            if s[start + char] != t[char]:
                cnt += 1
        ans = min(ans, cnt)
    
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
S = input()
T = input()
if T in S:
  print(0)
  sys.exit(0)

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    s = ins()
    t = ins()
    ans = len(s)
    for i in range(len(s)):
        if i + len(t) > len(s):
            break
        count = 0
        for j in range(len(t)):
            if t[j] != s[i + j]:
                count += 1
        ans = min(ans, count)

    return ans


print(solve())

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

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

ans=1000
for i in range(m-n+1):
    k=0
    for j in range(n):
        k+=s[i+j]!=t[j]
    ans=min(ans,k)

print(ans)

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

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

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

print(ans)

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

Solution (Python):

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x-1)
def lower_bound(li, num): 
	answer = -1
	start = 0
	end = len(li)-1

	while(start <= end):
		middle = (end+start)//2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer 
def upper_bound(li, num): 
	answer = -1
	start = 0
	end = len(li)-1

	while(start <= end):
		middle = (end+start)//2

		if li[middle] <= num:
			answer = middle
			start = middle + 1
		
		else:
			end = middle - 1
	return answer 

def abs(x):
	return x if x >=0 else -x
def binary_search(li, val, lb, ub): 
	ans = 0
	while(lb <= ub):
		mid = (lb+ub)//2
		
		if li[mid] > val:
			ub = mid-1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans
def kadane(x): 
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = mpos(sum_so_far,current_sum)
	return sum_so_far
def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum


'''
      ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ▄███████▀▀▀▀▀▀███████▄
░▐████▀▒▒Aestroix▒▒▀██████
░███▀▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀████
░▐██▒▒▒▒▒KARMANYA▒▒▒▒▒▒████▌         ________________
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌  ? ?   |▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒|
░░█▒▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▒▐███▌   ?    |___CM ONE DAY___|
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▒▐███▌     ? ? |▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒|
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌    ? ?    
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌      ? 
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█     ? ? 
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀       ? 
░░░░▄█████████ ████=========█▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
░░░░░████████████████
'''
from math import *

for _ in range(1):
	
	
	
	
	
	
	
	
	
	
	
	
	s = input()
	t = input()
	n = len(s)
	m = len(t)
	cnt = 10000
	for i in range(n-m+1):
		st = s[i:i+m]
		if st == t:
			cnt = 0
			break
		else:
			temp = 0
			for j in range(m):
				if st[j] != t[j]:
					temp += 1
			cnt = min(cnt,temp)
	print(cnt)

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

scores = {0}

for i in range(len(T)):
  for j in range(i, len(S) - len(T) + i + 1):
    if T[i] == S[j]:
      score = 1
      for k in range(1, len(T) - i):
        if T[i + k] == S[j + k]:
          score += 1
      scores.add(score)
      
print(len(T) - max(scores))

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

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

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

    ans = min(ans, diff_count)

print(ans)

Solution (Python):
a=str(input())
b=str(input())
ans=0
c=[]
l=0
for x in range(len(a)-len(b)+1):
    ans=0
    for i in range(len(b)):
       if a[i+l]!=b[i]:
           ans+=1
    l+=1
    c.append(ans)
print(min(c))

Solution (Python):

import collections
from functools import lru_cache
import bisect

INF = float("inf")
ZERO = 0
ONE = 1


def read():
    return input().strip()


def readInt():
    return int(input().strip())


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


def solve(s, t):
    M, N = len(s), len(t)
    ans = N

    for i in range(M-N+1):
        curr = N

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

        ans = min(ans, curr)

    return ans


s = read()
t = read()

print(solve(s, t))

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

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

m = 0
for i in range(len(s) - len(t) + 1):
    b = s[i : i + len(t)]
    cnt = 0
    for j, v in enumerate(b):
        if v == t[j]:
            cnt += 1
    m = max(m, cnt)
print(len(t) - m)

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

m = 0
for i in range(0, len(s) - len(t) + 1):
    b = s[i : i + len(t)]
    cnt = 0
    for j, v in enumerate(b):
        if v == t[j]:
            cnt += 1
    m = max(m, cnt)
print(len(t) - m)

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

Solution (Python):
s = input()
t = input()
maxi = 0 
for i in range(len(s)):
    maxG = 0
    if len(s[i:len(t)+i]) >= len(t):
        for l, j in zip(s[i:len(t)+i], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
print(len(t)-maxi)

Solution (Python):
S = input()
T = 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)

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 s[i+j] != t[j]:
            tmp += 1
    if tmp < ans:
        ans = tmp
print(ans)

Solution (Python):
s=input()
t=input()
res=len(t)
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
    res=min(tmp,res)
print(res)

Solution (Python):

def process():
    s = input()
    t = input()
    ls, lt = len(s), len(t)
    minchanges = float("inf")

    for i in range(ls-lt+1):
        changes = 0
        for j in range(lt):
            changes += 0 if s[i+j] == t[j] else 1
            if changes > minchanges:
                break
        if changes == 0:
            return 0
        
        minchanges = min(minchanges, changes)
    return minchanges


print(process())

Solution (Python):

import sys


def solve(S: str, T: str):
    length = len(T)
    s_list =[]
    counter = length
    ans = 0

    for i in range(len(S)-length+1):
        s = S[i:i+length]
        for i in range(length):
            
            if s[i] != T[i]:
                ans+=1

        counter = min(ans, counter)

        ans = 0

    return print(counter)



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    T = next(tokens)  
    solve(S, T)

if __name__ == '__main__':
    main()

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


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

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

for i in range(N+1-M):
  dis = M
  for j in range(M):
    if S[i:i+M][j] == T[j]:
      dis -= 1
  l.append(dis)
  
print(min(l))

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

Solution (Python):
S = input()
T = input()
ans = 1001
for i in range(len(S) - len(T) + 1):
  a = 0
  for s in range(len(T)):
    if T[s] != S[i+s]:
      a += 1
  if a < ans:
    ans = a
print(ans)

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

ans = 1000
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):
S = list(input())
T = list(input())
cmin = 1000

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

print(cmin)

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

lens = len(s)
lent = len(t)

total = 100000000
for i in range(lens-lent+1):
    count = 0
    for j in range(lent):
        if s[i+j]!=t[j]:
            count+=1
    total = min(total,count)

if total == 100000000:
    print(lent)
else:
    print(total)

Solution (Python):
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:],t[:-1]))for i in range(len(s)-len(t)+1)))

Solution (Python):
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:-1],t[:-1]))for i in range(len(s)-len(t)+1)))

Solution (Python):
s,t=input(),input()
print(min(sum(a!=b for a,b in zip(s[i:],t))for i in range(len(s)-len(t)+1)))

Solution (Python):
s,t=input(),input()
print(min(sum(a!=b for a,b in zip(s[i:],t))for i in range(len(s)-len(t)+1)))

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

Solution (Python):

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

 
ans = t
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)

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

 
ans = float('inf')
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)

Solution (Python):

 
S = input()
T = input()
 
result = 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
    result = min(result, t)
print(result)

Solution (Python):
from collections import deque
import sys, copy, itertools,heapq

 
S = input()
T = input()
 
result = 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
    result = min(result, t)
print(result)

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

result = 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
    result = min(result, t)
print(result)

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=input()
t=input()

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

c=[]

for i in range(sl-tl+1):
    cnt=0
    for j in range(tl):
        if s[i+j]==t[j]:
            cnt+=1
    c.append(cnt)
    cnt=0

print(tl-max(c))

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

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

A = []

for i in range(len_s - len_t + 1):
    total = 0
    for j in range(len_t):
        if t[j] != s[i + j]:
            total += 1
    A.append(total)

print(min(A))

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

ls = len(S)
lt = len(T)
ans = lt

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

print(ans)

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

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

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

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

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(ans, c)
print(ans)

Solution (Python):
from functools import reduce
import sys


def dump(x):
    print(x, file=sys.stderr)


s = input()
t = input()

min_diff = 100000000000


for i in range(len(s)-len(t)+1):
    matches = [1 if s[i+j] != t[j] else 0 for j in range(len(t))]
    diffn = sum(matches)
    min_diff = min(diffn,min_diff)
    dump(min_diff)

print(min_diff)

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

t_l = len(t)
diff_min = 999999999

def diff_str(s1, s2):
    diff_c = 0
    for j in range(len(s1)):
        if s1[j] != s2[j]:
            diff_c += 1
    return diff_c

if len(s) == len(t):
    diff_min = diff_str(s, t)

for i in range(len(s)-t_l):
    seq=s[i:i+t_l]
    diff_c = diff_str(seq, t)
    if diff_c < diff_min:
        diff_min = diff_c


print(diff_min)

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 t[j] != s[i:i+len(t)][j]:
            dif += 1
    ans = min(dif,ans)

print(ans)

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

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

result = 10000
for i in range(len(S) - len(T) + 1):
  
  start = i
  count = 0
  for j in range(len(T)):
    if T[j] != S[i + j]:
      count += 1
  result = min(count, result)

print(result)

Solution (Python):
s=input()
t=input()
ls=len(s);lt=len(t)
ans=10000
for i in range(ls-lt+1):
    ss=list(s[i:i+lt])
    tt=list(t)
    
    tmp=[tt[j] for j in range(lt) if tt[j]!=ss[j]]
    ans=min(ans,len(tmp))
print(ans)

Solution (Python):
a=input()
b=input()
c=1000

for i in range(len(a)-len(b)+1):
  d=0
  for j in range(len(b)):
    if a[i+j]!=b[j]:
      d+=1
  if d<c:
    c=d
print(c)

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

if(t in s):
    print(0)

result = [0] * ((len(s) - len(t)) + 1)
for i in range(len(s) - len(t) + 1):
    result[i] = len(t)
    for j in range(len(t)):
        if(s[i+j] == t[j]):
            result[i] -= 1
 
print(min(result))

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

l = [len(T)] * (len(S) - len(T) + 1)
for i in range(len(S) - len(T) + 1):
    split_str = S[i:len(T) + i]
    ck = [int(1) for i in range(len(T))]
    for j in range(len(T)):
        if T[j] == split_str[j]:
            ck[j] = 0

    l[i] = sum(ck)
print(min(l))

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

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

print(ans)

Solution (Python):
S = input()
T = input()
A = len(T)  
ls = []
for i in range(len(S)-len(T)+1):
    ls.append(S[i:i+len(T)])
for i in range(len(ls)):
    same = 0
    for j in range(len(T)):
        if T[j] == ls[i][j]:
            same += 1;
        if len(T)-same < A:
            A = len(T)-same
print(A)

Solution (Python):

S = input()
T = input()

N = len(T)

s_list = []
for i in range(len(S) - N + 1):
    s = S[i: i + N]
    s_list.append(s)

answer = N
for s in s_list:
    counter = 0
    for i in range(N):
        if s[i] != T[i]:
            counter += 1

    answer = min(answer, counter)

print(answer)

Solution (Python):
if __name__ == "__main__":
    s = input()
    t = input()

    ans = float('inf')
    for i in range(0, len(s) - len(t) + 1):
        diff_sum = 0
        for j in range(len(t)):
            if s[i + j] != t[j]:
                diff_sum += 1
        if ans > diff_sum:
            ans = diff_sum

    print(ans)

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