import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      String s = scanner.nextLine();
      String t = scanner.nextLine();
      int counter = 0;
      int count = 0;
      for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      }
      System.out.println(t.length() - count);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      String s = scanner.nextLine();
      String t = scanner.nextLine();
      int counter = 0;
      int count = 0;
      for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      }
      System.out.println(t.length() - count);
    }
} Main public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      String s = scanner.nextLine();
      String t = scanner.nextLine();
      int counter = 0;
      int count = 0;
      for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      }
      System.out.println(t.length() - count);
    } main {
      Scanner scanner = new Scanner(System.in);
      String s = scanner.nextLine();
      String t = scanner.nextLine();
      int counter = 0;
      int count = 0;
      for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      }
      System.out.println(t.length() - count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner String t = scanner.nextLine(); t scanner.nextLine() scanner.nextLine scanner int counter = 0; counter 0 int count = 0; count 0 for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      } int j = 0; int j = 0; j 0 j <= (s.length() - t.length()) j (s.length() - t.length()) s.length() s.length s t.length() t.length t j++ j++ j {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      } {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      } for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        } int i = 0; int i = 0; i 0 i < t.length() i t.length() t.length t i++ i++ i {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        } {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        } if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          } t.charAt(i) == s.charAt(j + i) t.charAt(i) t.charAt t i s.charAt(j + i) s.charAt s j + i j i {
            counter = counter + 1;
          } counter = counter + 1 counter counter + 1 counter 1 if (count == 0 || counter > count) {
          count = counter;
        } count == 0 || counter > count count == 0 count 0 counter > count counter count {
          count = counter;
        } count = counter count counter counter = 0 counter 0 System.out.println(t.length() - count) System.out.println System.out System System.out t.length() - count t.length() t.length t count String[] args args public class Main {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      String s = scanner.nextLine();
      String t = scanner.nextLine();
      int counter = 0;
      int count = 0;
      for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      }
      System.out.println(t.length() - count);
    }
} public class Main {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      String s = scanner.nextLine();
      String t = scanner.nextLine();
      int counter = 0;
      int count = 0;
      for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      }
      System.out.println(t.length() - count);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      String s = scanner.nextLine();
      String t = scanner.nextLine();
      int counter = 0;
      int count = 0;
      for (int j = 0; j <= (s.length() - t.length()); j++) {
        for (int i = 0; i < t.length(); i++) {
          if (t.charAt(i) == s.charAt(j + i)) {
            counter = counter + 1;
          }
        }
        if (count == 0 || counter > count) {
          count = counter;
        }
        counter = 0;
      }
      System.out.println(t.length() - count);
    }
}
