import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String S = stdin.readLine();
        String T = stdin.readLine();

        int tLen = T.length();
        int change = tLen;

        for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        }

        System.out.println(change);
        return;
    }

    public static int check(String S, String T){
        int change = 0;
        for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        }
        return change;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String S = stdin.readLine();
        String T = stdin.readLine();

        int tLen = T.length();
        int change = tLen;

        for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        }

        System.out.println(change);
        return;
    }

    public static int check(String S, String T){
        int change = 0;
        for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        }
        return change;
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String S = stdin.readLine();
        String T = stdin.readLine();

        int tLen = T.length();
        int change = tLen;

        for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        }

        System.out.println(change);
        return;
    } main {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String S = stdin.readLine();
        String T = stdin.readLine();

        int tLen = T.length();
        int change = tLen;

        for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        }

        System.out.println(change);
        return;
    } BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); stdin new BufferedReader(new InputStreamReader(System.in)) String S = stdin.readLine(); S stdin.readLine() stdin.readLine stdin String T = stdin.readLine(); T stdin.readLine() stdin.readLine stdin int tLen = T.length(); tLen T.length() T.length T int change = tLen; change tLen for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        } int i = 0; int i = 0; i 0 i+tLen <= S.length() i+tLen i tLen S.length() S.length S i++ i++ i {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        } {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        } String s1 = S.substring(i, i+tLen); s1 S.substring(i, i+tLen) S.substring S i i+tLen i tLen int tempLen = check(s1, T); tempLen check(s1, T) check s1 T if(tempLen < change)
                change = tempLen; tempLen < change tempLen change change = tempLen change tempLen System.out.println(change) System.out.println System.out System System.out change return; String[] args args public static int check(String S, String T){
        int change = 0;
        for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        }
        return change;
    } check {
        int change = 0;
        for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        }
        return change;
    } int change = 0; change 0 for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        } {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        } String temp1 = S.substring(i, i + 1); temp1 S.substring(i, i + 1) S.substring S i i + 1 i 1 String temp2 = T.substring(i, i + 1); temp2 T.substring(i, i + 1) T.substring T i i + 1 i 1 if (!temp1.equals(temp2)) {
                change++;
            } !temp1.equals(temp2) temp1.equals(temp2) temp1.equals temp1 temp2 {
                change++;
            } change++ change return change; change String S S String T T public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String S = stdin.readLine();
        String T = stdin.readLine();

        int tLen = T.length();
        int change = tLen;

        for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        }

        System.out.println(change);
        return;
    }

    public static int check(String S, String T){
        int change = 0;
        for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        }
        return change;
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String S = stdin.readLine();
        String T = stdin.readLine();

        int tLen = T.length();
        int change = tLen;

        for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        }

        System.out.println(change);
        return;
    }

    public static int check(String S, String T){
        int change = 0;
        for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        }
        return change;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String S = stdin.readLine();
        String T = stdin.readLine();

        int tLen = T.length();
        int change = tLen;

        for(int i = 0; i+tLen <= S.length(); i++) {
            String s1 = S.substring(i, i+tLen);
            int tempLen = check(s1, T);
            if(tempLen < change)
                change = tempLen;
        }

        System.out.println(change);
        return;
    }

    public static int check(String S, String T){
        int change = 0;
        for (int i = 0; i < S.length(); i++) {
            String temp1 = S.substring(i, i + 1);
            String temp2 = T.substring(i, i + 1);
            if (!temp1.equals(temp2)) {
                change++;
            }
        }
        return change;
    }
}
