import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String t = sc.nextLine();
    char[] sChar = s.toCharArray();
    char[] tChar = t.toCharArray();
    int ans = t.length();
    int searchN = s.length() - (t.length() - 1);
    for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    }
    System.out.println(ans);
    sc.close();
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays 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();
    char[] sChar = s.toCharArray();
    char[] tChar = t.toCharArray();
    int ans = t.length();
    int searchN = s.length() - (t.length() - 1);
    for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    }
    System.out.println(ans);
    sc.close();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String t = sc.nextLine();
    char[] sChar = s.toCharArray();
    char[] tChar = t.toCharArray();
    int ans = t.length();
    int searchN = s.length() - (t.length() - 1);
    for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    }
    System.out.println(ans);
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String t = sc.nextLine();
    char[] sChar = s.toCharArray();
    char[] tChar = t.toCharArray();
    int ans = t.length();
    int searchN = s.length() - (t.length() - 1);
    for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    }
    System.out.println(ans);
    sc.close();
  } 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 char[] sChar = s.toCharArray(); sChar s.toCharArray() s.toCharArray s char[] tChar = t.toCharArray(); tChar t.toCharArray() t.toCharArray t int ans = t.length(); ans t.length() t.length t int searchN = s.length() - (t.length() - 1); searchN s.length() - (t.length() - 1) s.length() s.length s (t.length() - 1) t.length() t.length t 1 for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    } int cnt = 0; int cnt = 0; cnt 0 cnt < searchN cnt searchN cnt++ cnt++ cnt {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    } {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    } int diffC = 0; diffC 0 for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      } int cnt2 = 0; int cnt2 = 0; cnt2 0 cnt2 < t.length() cnt2 t.length() t.length t cnt2++ cnt2++ cnt2 {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      } {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      } if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        } sChar[cnt2 + cnt] != tChar[cnt2] sChar[cnt2 + cnt] sChar cnt2 + cnt cnt2 cnt tChar[cnt2] tChar cnt2 {
          diffC++;
        } diffC++ diffC ans = Math.min(diffC, ans) ans Math.min(diffC, ans) Math.min Math diffC ans System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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();
    char[] sChar = s.toCharArray();
    char[] tChar = t.toCharArray();
    int ans = t.length();
    int searchN = s.length() - (t.length() - 1);
    for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    }
    System.out.println(ans);
    sc.close();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String t = sc.nextLine();
    char[] sChar = s.toCharArray();
    char[] tChar = t.toCharArray();
    int ans = t.length();
    int searchN = s.length() - (t.length() - 1);
    for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    }
    System.out.println(ans);
    sc.close();
  }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String t = sc.nextLine();
    char[] sChar = s.toCharArray();
    char[] tChar = t.toCharArray();
    int ans = t.length();
    int searchN = s.length() - (t.length() - 1);
    for (int cnt = 0; cnt < searchN; cnt++) {
      int diffC = 0;
      for (int cnt2 = 0; cnt2 < t.length(); cnt2++) {
        if (sChar[cnt2 + cnt] != tChar[cnt2]) {
          diffC++;
        }
      }
      ans = Math.min(diffC, ans);
    }
    System.out.println(ans);
    sc.close();
  }
}