import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = sc.next();

    int min = t.length();
    for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    }
    System.out.println(min);
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = sc.next();

    int min = t.length();
    for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    }
    System.out.println(min);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = sc.next();

    int min = t.length();
    for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    }
    System.out.println(min);
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = sc.next();

    int min = t.length();
    for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    }
    System.out.println(min);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String t = sc.next(); t sc.next() sc.next sc int min = t.length(); min t.length() t.length t for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    } int i = 0; int i = 0; i 0 i <= s.length() - t.length() i s.length() - t.length() s.length() s.length s t.length() t.length t i++ i++ i {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    } {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    } String ss = s.substring(i, i + t.length()); ss s.substring(i, i + t.length()) s.substring s i i + t.length() i t.length() t.length t int count = 0; count 0 for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      } int j = 0; int j = 0; j 0 j < t.length() j t.length() t.length t j++ j++ j {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      } {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      } if (ss.charAt(j) != t.charAt(j)) {
          count++;
        } ss.charAt(j) != t.charAt(j) ss.charAt(j) ss.charAt ss j t.charAt(j) t.charAt t j {
          count++;
        } count++ count min = Math.min(count, min) min Math.min(count, min) Math.min Math count min 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 s = sc.next();
    String t = sc.next();

    int min = t.length();
    for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    }
    System.out.println(min);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = sc.next();

    int min = t.length();
    for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    }
    System.out.println(min);
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = sc.next();

    int min = t.length();
    for (int i = 0; i <= s.length() - t.length(); i++) {
      String ss = s.substring(i, i + t.length());

      int count = 0;
      for (int j = 0; j < t.length(); j++) {
        if (ss.charAt(j) != t.charAt(j)) {
          count++;
        }
      }
      min = Math.min(count, min);
    }
    System.out.println(min);
  }
}