import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String str = sc.nextLine();
    int min = line.length();
    for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    }
    System.out.println(min);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String str = sc.nextLine();
    int min = line.length();
    for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    }
    System.out.println(min);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String str = sc.nextLine();
    int min = line.length();
    for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    }
    System.out.println(min);
  } main {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String str = sc.nextLine();
    int min = line.length();
    for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    }
    System.out.println(min);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc int min = line.length(); min line.length() line.length line for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    } int i = 0; int i = 0; i 0 i <= line.length() - str.length() i line.length() - str.length() line.length() line.length line str.length() str.length str i++ i++ i {
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    } {
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    } int temp = 0; temp 0 for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      } int j = 0; int j = 0; j 0 j < str.length() j str.length() str.length str j++ j++ j {
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      } {
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      } if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        } !String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j))) String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j))) String.valueOf(line.charAt(i + j)).equals String.valueOf(line.charAt(i + j)) String.valueOf String line.charAt(i + j) line.charAt line i + j i j String.valueOf(str.charAt(j)) String.valueOf String str.charAt(j) str.charAt str j {
          temp++;
        } temp++ temp if(temp < min){
        min = temp;
      } temp < min temp min {
        min = temp;
      } min = temp min temp System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String str = sc.nextLine();
    int min = line.length();
    for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    }
    System.out.println(min);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String str = sc.nextLine();
    int min = line.length();
    for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    }
    System.out.println(min);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    String str = sc.nextLine();
    int min = line.length();
    for(int i = 0;i <= line.length() - str.length();i++){
      int temp = 0;
      for(int j = 0;j < str.length();j++){
        if(!String.valueOf(line.charAt(i + j)).equals(String.valueOf(str.charAt(j)))){
          temp++;
        }
      }
      if(temp < min){
        min = temp;
      }
    }
    System.out.println(min);
  }
}