def subst(S, T)-> int:

  lenT = len(T)

  result = lenT

  for i in range(len(S) - lenT + 1):

    # tempS = S[i-lenT:i]

    tempResult = 0

    for j in range(lenT):

      if T[j] != S[j + i]:

        tempResult += 1

    if tempResult < result:

      result = tempResult

    

  return result



if __name__ == "__main__":

  S = eval(input())

  T = eval(input())

  print((subst(S, T)))
def subst(S, T)-> int:

  lenT = len(T)

  result = lenT

  for i in range(lenT, len(S) + 1):

    tempS = S[i-lenT:i]

    tempResult = 0

    for j in range(lenT):

      if T[j] != tempS[j]:

        tempResult += 1

    if tempResult < result:

      result = tempResult

    

  return result



if __name__ == "__main__":

  S = eval(input())

  T = eval(input())

  print((subst(S, T)))
def subst(S, T) -> int:
    lenT = len(T)
    result = lenT
    for i in range(len(S) - lenT + 1):
        # tempS = S[i-lenT:i]
        tempResult = 0
        for j in range(lenT):
            if T[j] != S[j + i]:
                tempResult += 1
        if tempResult < result:
            result = tempResult
    return result


if __name__ == "__main__":
    S = eval(input())
    T = eval(input())
    print((subst(S, T)))

def subst(S, T) -> int:
    lenT = len(T)
    result = lenT
    for i in range(lenT, len(S) + 1):
        tempS = S[i - lenT : i]
        tempResult = 0
        for j in range(lenT):
            if T[j] != tempS[j]:
                tempResult += 1
        if tempResult < result:
            result = tempResult
    return result


if __name__ == "__main__":
    S = eval(input())
    T = eval(input())
    print((subst(S, T)))

-    for i in range(len(S) - lenT + 1): -        # tempS = S[i-lenT:i] +    for i in range(lenT, len(S) + 1): +        tempS = S[i - lenT : i] -            if T[j] != S[j + i]: +            if T[j] != tempS[j]: