import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String T = sc.next();
        String S = sc.next();
 
        int res = (int)1e9;
        int legth = (T.length() - S.length()) + 1;
        for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        }
        System.out.println(res);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String T = sc.next();
        String S = sc.next();
 
        int res = (int)1e9;
        int legth = (T.length() - S.length()) + 1;
        for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        }
        System.out.println(res);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String T = sc.next();
        String S = sc.next();
 
        int res = (int)1e9;
        int legth = (T.length() - S.length()) + 1;
        for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        }
        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        String T = sc.next();
        String S = sc.next();
 
        int res = (int)1e9;
        int legth = (T.length() - S.length()) + 1;
        for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        }
        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String T = sc.next(); T sc.next() sc.next sc String S = sc.next(); S sc.next() sc.next sc int res = (int)1e9; res (int)1e9 int legth = (T.length() - S.length()) + 1; legth (T.length() - S.length()) + 1 (T.length() - S.length()) T.length() T.length T S.length() S.length S 1 for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        } int index = 0; int index = 0; index 0 index < legth index legth index++ index++ index {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        } {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        } int count = 0; count 0 for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            } int j = 0; int j = 0; j 0 j < S.length() j S.length() S.length S j++ j++ j {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            } {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            } if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                } S.charAt(j) != T.charAt(index + j) S.charAt(j) S.charAt S j T.charAt(index + j) T.charAt T index + j index j {
                    count++;
                } count++ count if(count < res) {
                res = count;
            } count < res count res {
                res = count;
            } res = count res count System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String T = sc.next();
        String S = sc.next();
 
        int res = (int)1e9;
        int legth = (T.length() - S.length()) + 1;
        for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        }
        System.out.println(res);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String T = sc.next();
        String S = sc.next();
 
        int res = (int)1e9;
        int legth = (T.length() - S.length()) + 1;
        for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        }
        System.out.println(res);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String T = sc.next();
        String S = sc.next();
 
        int res = (int)1e9;
        int legth = (T.length() - S.length()) + 1;
        for (int index = 0; index < legth; index++) {
            int count = 0;
            for (int j = 0; j < S.length(); j++) {
                if (S.charAt(j) != T.charAt(index + j)) {
                    count++;
                }
            }
            if(count < res) {
                res = count;
            }
        }
        System.out.println(res);
    }
}