import java.util.Scanner;
import java.util.ArrayList;


public class Main{
 public static void main(String args[]){
  Scanner scanner = new Scanner(System.in);
  String esu = scanner.next();
  String t = scanner.next();   
  int kaisu = esu.length() - t.length() + 1;
  
  //ArrayList<Integer> mat = new ArrayList<Integer>(); 
  int mat[];
  mat = new int[kaisu];
   
   for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    }
   int min =0;
   for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } 

  System.out.println(t.length()-min);
   
 }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main{
 public static void main(String args[]){
  Scanner scanner = new Scanner(System.in);
  String esu = scanner.next();
  String t = scanner.next();   
  int kaisu = esu.length() - t.length() + 1;
  
  //ArrayList<Integer> mat = new ArrayList<Integer>(); 
  int mat[];
  mat = new int[kaisu];
   
   for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    }
   int min =0;
   for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } 

  System.out.println(t.length()-min);
   
 }
} Main public static void main(String args[]){
  Scanner scanner = new Scanner(System.in);
  String esu = scanner.next();
  String t = scanner.next();   
  int kaisu = esu.length() - t.length() + 1;
  
  //ArrayList<Integer> mat = new ArrayList<Integer>(); 
  int mat[];
  mat = new int[kaisu];
   
   for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    }
   int min =0;
   for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } 

  System.out.println(t.length()-min);
   
 } main {
  Scanner scanner = new Scanner(System.in);
  String esu = scanner.next();
  String t = scanner.next();   
  int kaisu = esu.length() - t.length() + 1;
  
  //ArrayList<Integer> mat = new ArrayList<Integer>(); 
  int mat[];
  mat = new int[kaisu];
   
   for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    }
   int min =0;
   for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } 

  System.out.println(t.length()-min);
   
 } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String esu = scanner.next(); esu scanner.next() scanner.next scanner String t = scanner.next(); t scanner.next() scanner.next scanner int kaisu = esu.length() - t.length() + 1; kaisu esu.length() - t.length() + 1 esu.length() - t.length() esu.length() esu.length esu t.length() t.length t 1 int mat[]; mat mat = new int[kaisu] mat new int[kaisu] kaisu for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    } int i=0; int i=0; i 0 i<kaisu i kaisu i++ i++ i {
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    } {
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    } for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      } int j=0; int j=0; j 0 j<t.length() j t.length() t.length t j++ j++ j {
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      } {
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      } if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        } esu.charAt(i+j)==t.charAt(j) esu.charAt(i+j) esu.charAt esu i+j i j t.charAt(j) t.charAt t j {
         mat[i]++;
        } mat[i]++ mat[i] mat i {
        } int min =0; min 0 for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } int i=0; int i=0; i 0 i<kaisu i kaisu i++ i++ i {
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } {
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } if(mat[i]>min){
       min = mat[i];
     }else{
     } mat[i]>min mat[i] mat i min {
       min = mat[i];
     } min = mat[i] min mat[i] mat i {
     } System.out.println(t.length()-min) System.out.println System.out System System.out t.length()-min t.length() t.length t min String args[] args public class Main{
 public static void main(String args[]){
  Scanner scanner = new Scanner(System.in);
  String esu = scanner.next();
  String t = scanner.next();   
  int kaisu = esu.length() - t.length() + 1;
  
  //ArrayList<Integer> mat = new ArrayList<Integer>(); 
  int mat[];
  mat = new int[kaisu];
   
   for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    }
   int min =0;
   for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } 

  System.out.println(t.length()-min);
   
 }
} public class Main{
 public static void main(String args[]){
  Scanner scanner = new Scanner(System.in);
  String esu = scanner.next();
  String t = scanner.next();   
  int kaisu = esu.length() - t.length() + 1;
  
  //ArrayList<Integer> mat = new ArrayList<Integer>(); 
  int mat[];
  mat = new int[kaisu];
   
   for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    }
   int min =0;
   for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } 

  System.out.println(t.length()-min);
   
 }
} Main
import java.util.Scanner;
import java.util.ArrayList;


public class Main{
 public static void main(String args[]){
  Scanner scanner = new Scanner(System.in);
  String esu = scanner.next();
  String t = scanner.next();   
  int kaisu = esu.length() - t.length() + 1;
  
  //ArrayList<Integer> mat = new ArrayList<Integer>(); 
  int mat[];
  mat = new int[kaisu];
   
   for(int i=0;i<kaisu;i++){
      for(int j=0;j<t.length();j++){
        if(esu.charAt(i+j)==t.charAt(j)){
         mat[i]++;
        }else{
        }
      }  
    }
   int min =0;
   for(int i=0;i<kaisu;i++){
     if(mat[i]>min){
       min = mat[i];
     }else{
     }
   } 

  System.out.println(t.length()-min);
   
 }
}