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 sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=input()
t=input()
ls=len(s)
lt=len(t)
ans=100000
for i in range(ls-lt+1):
    c=0
    for k in range(lt):
        if s[i+k]!=t[k]:
            c+=1
    ans=min(ans,c)
print(ans)

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

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

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

ans = len(T)

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

for offset in range(len(S)-len(T)+1):
    ans = min(ans, dist(S[offset:(offset+len(T))], T))
print(ans)

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

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

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

Solution (Python):

S = input()
T = input()

n = len(S)
m = len(T)
res = n + 1
for i in range(n - m + 1):
    cnt = 0
    for j in range(m):
        cnt += int(S[i + j] != T[j])
    res = min(res, cnt)

print(res)

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

Solution (Python):
s = str(input())
t = str(input())
n = len(s)
m = len(t)
ans = float("inf")
for i in range(n-m+1):
  si = s[i:i+m]
  c = 0
  for j in range(m):
    if si[j] != t[j]:
      c += 1
  if c < ans:
    ans = c
print(ans)

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

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

min_val = 10000

for i in range(sl-tl+1):
    tmp = 0
    for j in range(tl):
        if t[j] != s[j+i]:
            tmp += 1
    min_val = min(min_val, tmp)

print(min_val)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

s = input()[:-1]

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

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

print(ans)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

s = STR()
t = STR()
ans = inf
lt = len(t)
for strt in range(len(s) - len(t) + 1):
    a = s[strt:strt + lt]
    cnt = 0
    for i in range(lt):
        if a[i] != t[i]:
            cnt += 1
    ans = min(ans, cnt)
print(ans)

Solution (Python):
def diff(a, b):
    ret = 0
    for c1, c2 in zip(a, b):
        if c1 != c2:
            ret += 1

    return ret

S = input()
T = input()

l = len(T)
ans = 10 ** 9
for i in range(len(S) - l + 1):
    
    ans = min(ans, diff(S[i:i+l], T))

print(ans)

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

Solution (Python):


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

a=input()
b=input()
tot=len(a)

i=0
j=len(b)-1

while j<len(a):
	tot=min(tot,cc(b,a[i:j+1]))
	i+=1
	j+=1

print(tot)

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

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

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

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

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

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

print(answer)

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


n = len(S) - len(T) + 1
ans = len(S)

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

print (ans)

Solution (Python):
s=input()
t=input()
ans=10**8
n=len(s);m=len(t)
for i in range(n-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):


s=input()
t=input()
sl=len(s)
tl=len(t)
ans=10**18
for i in range(sl-tl+1):
    tmp=s[i:i+tl]
    cnt=0
    for j in range(tl):
        if tmp[j]!=t[j]:
            cnt+=1
    ans=min(ans,cnt)
print(ans)

Solution (Python):
S=input()
T=input()
ans=len(T)
for i in range(0, 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)

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    S = in_s()
    T = in_s()

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

    ans = 10000
    for i in range(ns - nt + 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 = input()
t = input()
ls = len(s)
lt = len(t)
ans = lt
for i in range(ls - lt + 1):
    diff = 0
    for j in range(lt):
        if s[i + j] != t[j]:
            diff += 1
    ans = min(ans, diff)
print(ans)

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

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

res = 10**18

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

print(res)

Solution (Python):


from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

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


def main():
	S = input()
	T = input()
	ans = INF
	N = len(S)
	M = len(T)
	for i in range(N - M + 1):
		text = S[i:i + M]
		val = 0
		for j in range(M):
			if text[j] != T[j]:
				val += 1

		ans = min(ans, val)

	print(ans)

if __name__ == '__main__':
	main()

Solution (Python):


import os,sys
from io import BytesIO, IOBase

def main():
    s,t = input().strip(),input().strip()
    fin = 10**10
    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
        fin = min(fin,ans)
    print(fin)


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):


'''
Author: andyli
Time: 2020-08-29 19:58:34
'''

import os
from io import BytesIO, IOBase
import sys


def main():
    s = input()
    t = input()
    n,m = len(s), len(t)
    ans = n
    for i in range(n-m+1):
        c = 0
        for j in range(m):
            if s[i+j] != t[j]:
                c += 1
        ans = min(ans, c)
    print(ans)
    return



BUFSIZE = 1048576


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)
def input(): return sys.stdin.readline().rstrip('\r\n')




if __name__ == '__main__':
    main()

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

ans = len(T)

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    ans = 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
        if ans > tmp:
            ans = tmp

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
'''
自宅用PCでの解答
'''
import math

import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit


ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7 
dir = [(-1,0),(0,-1),(1,0),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    s = input()
    t = input()
    ls = len(s)
    lt = len(t)
    mi = 10**18
    for i in range(ls-lt+1):
        nm = 0
        for j in range(lt):
            if s[i+j] != t[j]:
                nm += 1
        if nm < mi:
            mi = nm

    print(mi)
    return None

if __name__ == '__main__':
    main()

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

INF = 10**18

S = list(map(ord, readline().strip()))
T = list(map(ord, readline().strip()))
N = len(S)
M = len(T)

ans = INF

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

print(ans)

Solution (Python):

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

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

Solution (Python):
import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)

def input():
    return sys.stdin.readline()[:-1]

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

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    S, T = [input(), input()]

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

    m = math.inf

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

    print(m)

if __name__ == '__main__':
    main()

Solution (Python):

if __name__ == "__main__":
    S = input()
    T = input()
    N = len(S)
    M = len(T)
    ans = 10**9
    for i in range(N - 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()

    min_cnt = float('inf')
    for i in range(len(S)):
        U = S[i:i+len(T)]
        if len(U) == len(T):
            cnt = 0
            for i in range(len(T)):
                if U[i] != T[i]:
                    cnt += 1
            min_cnt = min(min_cnt, cnt)
    return min_cnt

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

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

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

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

res = float('inf')
for i in range(len(s)-len(t)+1):
    tmp_s = s[i:i+len(t)]

    cnt = 0
    for j in range(len(t)):
        if tmp_s[j] != t[j]:
            cnt += 1
    
    res = min(res, cnt)

print(res)

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

def count_diff2(a,b):
    cnt = 0
    for c1,c2 in zip(a, b):
        if c1 != c2:
            cnt += 1
    return cnt

a = 1e9
for i in range(len(s)-len(t)+1):
    le = s[i:i+len(t)]
    a = min(a, count_diff2(le, t))
print(a)

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  


S = LS2()
T = LS2()
a = len(S)
b = len(T)

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

Solution (Python):
S = input()
T = input()
ans = 10 ** 9
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):
def main():
    S = input()
    T = input()
    N = len(S)
    M = len(T)
    ans = 10**6
    for i in range(N-M+1):
        cur = 0
        for j in range(M):
            if S[i+j] != T[j]:
                cur += 1
        ans = min(ans, cur)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]

def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  s=S()
  T=S()
  ans=inf

  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)

  return ans


print(main())

Solution (Python):
S = input()
T = input()
ans = 1000000
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
    if cnt < ans:
        ans = cnt
print(ans)

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

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

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

Solution (Python):
from sys import stdin, setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    S = input()
    T = input()
    mc = 100000
    for i in range(len(S) - len(T) + 1):
        c = 0
        si = S[i:i + len(T)]
        for k in range(len(T)):
            if si[k] != T[k]:
                c += 1
        mc = min(mc, c)
    print(mc)

if __name__ == '__main__':
    main()

Solution (Python):
a = input()
b = input()
la = len(a)
lb = len(b)
can = []
for i in range(la-lb+1):
  tmp = 0
  for j in range(lb):
    if b[j] != a[i+j]:
      tmp += 1
  can.append(tmp)
print(min(can))

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

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

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

Solution (Python):
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, -1, mod)


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

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

Solution (Python):
s=raw_input()
t=raw_input()
maxx=len(t)
for i in range(len(s)-len(t)+1):
    val=0
    for j in range(i,i+len(t)):
        if s[j]!=t[j-i]:
            val+=1
    maxx=min(maxx,val)
print maxx

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

ss = len(s)
tt = len(t)

ans = 1145141919
for i in range(ss-tt+1):
    a = 0
    for j in range(tt):
        if s[i+j] != t[j]:
            a += 1
    ans = min(a,ans)
    
print(ans)

Solution (Python):
def diff(u, v):
    ans = 0
    for i in range(len(u)):
        if u[i] != v[i]:
            ans += 1
    return ans

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

Solution (Python):

s = input()
t = input()

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

def f(p, q):
    cnt = 0
    for i, j in zip(p, q):
        if i != j:
            cnt +=1
    return cnt

res = 10 ** 100
for i in range(sl - tl + 1):
    ss = s[i:i + tl]
    res = min(res, f(ss, t))
print(res)

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

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)

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input())[: -1]
T = list(input())[: -1]
res = len(T)
for i in range(len(S) - len(T) + 1):
  t = 0
  for j in range(len(T)): t += S[i + j] == T[j]
  res = min(res, len(T) - t)
print(res)

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

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

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

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

ans = 10**10

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

print(ans)

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

ans = 10 ** 18
for i in range(Ns - Nt + 1):
    cnt = 0
    for j in range(Nt):
        if S[i + j] != T[j]:
            cnt += 1
    ans = min(ans, cnt)

print(ans)

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

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

s=input()
t=input()
ans=INF
for i in range(len(s)-len(t)+1):
    tmp=0
    for x,y in zip(t,s[i:i+len(t)]):
        tmp+=(x!=y)
    ans=min(ans,tmp)
print(ans)

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

Solution (Python):
s = input()
lens = len(s)
t = input()
lent = len(t)
ans = 9999999
for j in range(lens-lent+1):
	tmp = 0
	for k in range(lent):
		if s[j+k] != t[k]:
			tmp += 1
	ans = min(tmp, ans)
print(ans)

Solution (Python):
def main():
    S = input()
    T = input()
    m = 10000
    for i in range(len(S) - len(T) + 1):
        c = 0
        for s, t in zip(S[i:], T):
            if s != t:
                c += 1
        m = min(c, m)
    return m

print(main())

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

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)

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

Solution (Python):
FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]


from collections import defaultdict as ddic, Counter, deque
import heapq, bisect, itertools
MOD = 10 ** 9 + 7
S=rr(); T=rr()

ans = len(T)
for i in xrange(len(S) - len(T) + 1):
    ham = sum(S[j+i] != T[j] for j in xrange(len(T)))
    ans = min(ans, ham)

print ans

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

A=len(S)
B=len(T)

M=10**10
for i in range(A-B+1):
    K=0
    for k in range(B):
        K+=(S[i+k]!=T[k])
    M=min(M,K)
print(M)

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

print(min(sum(c != d for c,d in zip(S[i:i+len(T)],T)) for i in range(len(S)-len(T)+1)))

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

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

Solution (Python):
import sys

sys.setrecursionlimit(500005)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

s = ns()
t = ns()

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