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

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();
        String t = sc.next();

        int HOGE = 100000;
        int min = HOGE;
        for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        }
        System.out.println(min == HOGE ? 0 : min);
        // out.println("Hello World");
        out.flush();
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.*; util.* java public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();
        String t = sc.next();

        int HOGE = 100000;
        int min = HOGE;
        for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        }
        System.out.println(min == HOGE ? 0 : min);
        // out.println("Hello World");
        out.flush();
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main void run() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();
        String t = sc.next();

        int HOGE = 100000;
        int min = HOGE;
        for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        }
        System.out.println(min == HOGE ? 0 : min);
        // out.println("Hello World");
        out.flush();
    } run {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();
        String t = sc.next();

        int HOGE = 100000;
        int min = HOGE;
        for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        }
        System.out.println(min == HOGE ? 0 : min);
        // out.println("Hello World");
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String s = sc.next(); s sc.next() sc.next sc String t = sc.next(); t sc.next() sc.next sc int HOGE = 100000; HOGE 100000 int min = HOGE; min HOGE for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        } int i = 0; int i = 0; i 0 i <= s.length() - t.length() i s.length() - t.length() s.length() s.length s t.length() t.length t i++ i++ i {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        } {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        } int count = 0; count 0 for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            } 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)) {
                    count++;
                }
            } {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            } if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                } 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 {
                    count++;
                } count++ count min = Math.min(min, count) min Math.min(min, count) Math.min Math min count System.out.println(min == HOGE ? 0 : min) System.out.println System.out System System.out min == HOGE ? 0 : min min == HOGE min HOGE 0 min out.flush() out.flush out void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    } debug {
        System.err.println(Arrays.deepToString(os));
    } System.err.println(Arrays.deepToString(os)) System.err.println System.err System System.err Arrays.deepToString(os) Arrays.deepToString Arrays os Object... os os public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();
        String t = sc.next();

        int HOGE = 100000;
        int min = HOGE;
        for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        }
        System.out.println(min == HOGE ? 0 : min);
        // out.println("Hello World");
        out.flush();
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();
        String t = sc.next();

        int HOGE = 100000;
        int min = HOGE;
        for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        }
        System.out.println(min == HOGE ? 0 : min);
        // out.println("Hello World");
        out.flush();
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main

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

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();
        String t = sc.next();

        int HOGE = 100000;
        int min = HOGE;
        for (int i = 0; i <= s.length() - t.length(); i++) {
            int count = 0;
            for (int j = 0; j < t.length(); j++) {
                if (s.charAt(i + j) != t.charAt(j)) {
                    count++;
                }
            }
            min = Math.min(min, count);
        }
        System.out.println(min == HOGE ? 0 : min);
        // out.println("Hello World");
        out.flush();
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}
