import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        char[] c1 = sc.next().toCharArray();
        char[] c2 = sc.next().toCharArray();
        int num1 = c1.length;
        int num2 = c2.length;
        int count = 0;
        
        for(int i=0; i<(num1-num2+1); i++){
          int cc = 0;
          for(int j=0; j<c2.length; j++){
              if(c1[i+j]==c2[j]){
                  cc++;
              }
          }
          if(count<cc){
              count = cc;
              //System.out.println("i "+ i);
              //System.out.println("cc "+ cc);
              
          }
        }

        System.out.println(num2-count);
        
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz