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 df = s.length() - t.length();
        int ans = 9999999;
        for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        }
            System.out.println(ans);
    }
   
}
 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 df = s.length() - t.length();
        int ans = 9999999;
        for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        }
            System.out.println(ans);
    }
   
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 配列
        String s = sc.next();
        String t = sc.next();

        int df = s.length() - t.length();
        int ans = 9999999;
        for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        }
            System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        // 配列
        String s = sc.next();
        String t = sc.next();

        int df = s.length() - t.length();
        int ans = 9999999;
        for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        }
            System.out.println(ans);
    } 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 df = s.length() - t.length(); df s.length() - t.length() s.length() s.length s t.length() t.length t int ans = 9999999; ans 9999999 for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        } int i = 0; int i = 0; i 0 i <= df i df i++ i++ i {
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        } {
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        } int dd = 0; dd 0 for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            } int j = 0; int j = 0; j 0 j < t.length() j t.length() t.length t j++ j++ j {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            } {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            } if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                } s.charAt(i + j) != t.charAt(j) s.charAt(i + j) s.charAt s i + j i j t.charAt(j) t.charAt t j {
                    dd++;
                } dd++ dd if(ans > dd) {
                ans = dd;
            } ans > dd ans dd {
                ans = dd;
            } ans = dd ans dd System.out.println(ans) System.out.println System.out System System.out ans 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 df = s.length() - t.length();
        int ans = 9999999;
        for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        }
            System.out.println(ans);
    }
   
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 配列
        String s = sc.next();
        String t = sc.next();

        int df = s.length() - t.length();
        int ans = 9999999;
        for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        }
            System.out.println(ans);
    }
   
} 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 df = s.length() - t.length();
        int ans = 9999999;
        for (int i = 0;i <= df;i++){
            int dd = 0;
            for (int j = 0;j < t.length(); j++) {
                if(s.charAt(i + j) != t.charAt(j)) {
                    dd++;
                }
            }
            if(ans > dd) {
                ans = dd;
            }
        }
            System.out.println(ans);
    }
   
}

