import java.util.*;
 
public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    String S=sc.nextLine();
    String T=sc.nextLine();
    int shortest=1001;
	int data=0;
    char[] Schar=S.toCharArray();
    char[] Tchar=T.toCharArray();
    for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    }
 
   System.out.println(shortest);   
  
  }
} import java.util.*; util.* java public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    String S=sc.nextLine();
    String T=sc.nextLine();
    int shortest=1001;
	int data=0;
    char[] Schar=S.toCharArray();
    char[] Tchar=T.toCharArray();
    for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    }
 
   System.out.println(shortest);   
  
  }
} Main public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    String S=sc.nextLine();
    String T=sc.nextLine();
    int shortest=1001;
	int data=0;
    char[] Schar=S.toCharArray();
    char[] Tchar=T.toCharArray();
    for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    }
 
   System.out.println(shortest);   
  
  } main {
    Scanner sc=new Scanner(System.in);
    String S=sc.nextLine();
    String T=sc.nextLine();
    int shortest=1001;
	int data=0;
    char[] Schar=S.toCharArray();
    char[] Tchar=T.toCharArray();
    for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    }
 
   System.out.println(shortest);   
  
  } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String S=sc.nextLine(); S sc.nextLine() sc.nextLine sc String T=sc.nextLine(); T sc.nextLine() sc.nextLine sc int shortest=1001; shortest 1001 int data=0; data 0 char[] Schar=S.toCharArray(); Schar S.toCharArray() S.toCharArray S char[] Tchar=T.toCharArray(); Tchar T.toCharArray() T.toCharArray T for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    } int i=0; int i=0; i 0 i<Schar.length-Tchar.length+1 i Schar.length-Tchar.length+1 Schar.length-Tchar.length Schar.length Schar Schar.length Tchar.length Tchar Tchar.length 1 i++ i++ i {
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    } {
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    } data=0 data 0 for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      } int j=0; int j=0; j 0 j<Tchar.length j Tchar.length Tchar Tchar.length j++ j++ j {
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      } {
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      } if(Schar[i+j]!=Tchar[j]){
          data++;
        } Schar[i+j]!=Tchar[j] Schar[i+j] Schar i+j i j Tchar[j] Tchar j {
          data++;
        } data++ data if(data<shortest){
        shortest=data;
      } data<shortest data shortest {
        shortest=data;
      } shortest=data shortest data System.out.println(shortest) System.out.println System.out System System.out shortest String args[] args public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    String S=sc.nextLine();
    String T=sc.nextLine();
    int shortest=1001;
	int data=0;
    char[] Schar=S.toCharArray();
    char[] Tchar=T.toCharArray();
    for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    }
 
   System.out.println(shortest);   
  
  }
} public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    String S=sc.nextLine();
    String T=sc.nextLine();
    int shortest=1001;
	int data=0;
    char[] Schar=S.toCharArray();
    char[] Tchar=T.toCharArray();
    for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    }
 
   System.out.println(shortest);   
  
  }
} Main
import java.util.*;
 
public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    String S=sc.nextLine();
    String T=sc.nextLine();
    int shortest=1001;
	int data=0;
    char[] Schar=S.toCharArray();
    char[] Tchar=T.toCharArray();
    for(int i=0;i<Schar.length-Tchar.length+1;i++){
      data=0;
      for(int j=0;j<Tchar.length;j++){
       	if(Schar[i+j]!=Tchar[j]){
          data++;
        }
      }
	  if(data<shortest){
        shortest=data;
      }
       
    }
 
   System.out.println(shortest);   
  
  }
}