import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int n = s.length;
        int m = t.length;

        int min = m;
        for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        }

        System.out.println(min);

    }



} import java.util.*; util.* java public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int n = s.length;
        int m = t.length;

        int min = m;
        for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        }

        System.out.println(min);

    }



} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int n = s.length;
        int m = t.length;

        int min = m;
        for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        }

        System.out.println(min);

    } main {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int n = s.length;
        int m = t.length;

        int min = m;
        for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        }

        System.out.println(min);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc char[] t = sc.next().toCharArray(); t sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int n = s.length; n s.length s s.length int m = t.length; m t.length t t.length int min = m; min m for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        } int i=0; int i=0; i 0 i+m-1<n i+m-1 i+m i m 1 n i++ i++ i {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        } {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        } int a = 0; a 0 for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            } int j=0; int j=0; j 0 j<m j m j++ j++ j {
                if(s[i+j] != t[j]) {
                    a++;
                }
            } {
                if(s[i+j] != t[j]) {
                    a++;
                }
            } if(s[i+j] != t[j]) {
                    a++;
                } s[i+j] != t[j] s[i+j] s i+j i j t[j] t j {
                    a++;
                } a++ a min = Math.min(min, a) min Math.min(min, a) Math.min Math min a 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) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int n = s.length;
        int m = t.length;

        int min = m;
        for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        }

        System.out.println(min);

    }



} public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int n = s.length;
        int m = t.length;

        int min = m;
        for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        }

        System.out.println(min);

    }



} Main
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();

        int n = s.length;
        int m = t.length;

        int min = m;
        for(int i=0; i+m-1<n; i++) {
            int a = 0;
            for(int j=0; j<m; j++) {
                if(s[i+j] != t[j]) {
                    a++;
                }
            }
            min = Math.min(min, a);

        }

        System.out.println(min);

    }



}