import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) char[] s = br.readLine().toCharArray(); s br.readLine().toCharArray() br.readLine().toCharArray br.readLine() br.readLine br char[] t = br.readLine().toCharArray(); t br.readLine().toCharArray() br.readLine().toCharArray br.readLine() br.readLine br int minCount = t.length minCount t.length t t.length count = 0; count 0 for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        } int i=0; int i=0; i 0 i<=s.length-t.length i s.length-t.length s.length s s.length t.length t t.length i++ i++ i {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        } {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        } int temp = 0; temp 0 count = 0 count 0 while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            } temp < t.length temp t.length t t.length {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            } if(s[temp+i] != t[temp])
                    count++; s[temp+i] != t[temp] s[temp+i] s temp+i temp i t[temp] t temp count++ count temp++ temp minCount = Math.min(minCount, count) minCount Math.min(minCount, count) Math.min Math minCount count System.out.println(minCount) System.out.println System.out System System.out minCount br.close() br.close br String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    }
} Main
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    }
}