import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String sub = scan.nextLine();

        int min = 0;

        for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        }

        System.out.println(min);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String sub = scan.nextLine();

        int min = 0;

        for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        }

        System.out.println(min);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String sub = scan.nextLine();

        int min = 0;

        for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        }

        System.out.println(min);
    } main {
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String sub = scan.nextLine();

        int min = 0;

        for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        }

        System.out.println(min);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.nextLine(); s scan.nextLine() scan.nextLine scan String sub = scan.nextLine(); sub scan.nextLine() scan.nextLine scan int min = 0; min 0 for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        } int i = 0; int i = 0; i 0 i <= s.length()-sub.length() i s.length()-sub.length() s.length() s.length s sub.length() sub.length sub i++ i++ i {
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        } {
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        } String sSub = s.substring(i,i+sub.length()); sSub s.substring(i,i+sub.length()) s.substring s i i+sub.length() i sub.length() sub.length sub int count = 0; count 0 for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            } int j = 0; int j = 0; j 0 j < sub.length() j sub.length() sub.length sub j++ j++ j {
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            } {
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            } if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                } sSub.charAt(j) != sub.charAt(j) sSub.charAt(j) sSub.charAt sSub j sub.charAt(j) sub.charAt sub j {
                    count++;
                } count++ count if (i == 0)
                min = count;
            else if (count < min)
                min = count; i == 0 i 0 min = count min count if (count < min)
                min = count; count < min count min min = count min count System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String sub = scan.nextLine();

        int min = 0;

        for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        }

        System.out.println(min);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String sub = scan.nextLine();

        int min = 0;

        for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        }

        System.out.println(min);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.nextLine();
        String sub = scan.nextLine();

        int min = 0;

        for (int i = 0; i <= s.length()-sub.length(); i++){
            String sSub = s.substring(i,i+sub.length());
            int count = 0;
            for (int j = 0; j < sub.length(); j++){
                if (sSub.charAt(j) != sub.charAt(j)){
                    count++;
                }
            }
            if (i == 0)
                min = count;
            else if (count < min)
                min = count;
        }

        System.out.println(min);
    }
}
