
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        String t = in.next(); // s muss t enthaalen
        int count = 0;
        int min = 9999;
        for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        }
        if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        String t = in.next(); // s muss t enthaalen
        int count = 0;
        int min = 9999;
        for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        }
        if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        String t = in.next(); // s muss t enthaalen
        int count = 0;
        int min = 9999;
        for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        }
        if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min);
    } main {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        String t = in.next(); // s muss t enthaalen
        int count = 0;
        int min = 9999;
        for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        }
        if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String s = in.next(); s in.next() in.next in String t = in.next(); t in.next() in.next in int count = 0; count 0 int min = 9999; min 9999 for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                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 {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        } {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        } count = 0 count 0 for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    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)){
                    
                } else {
                    count++;
                    
                }
   
            } {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            } if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    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 if(min>count){
                min = count;
            } min>count min count {
                min = count;
            } min = count min count if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min); s.contains(t) s.contains s t {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 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 in = new Scanner(System.in);
        String s = in.next();
        String t = in.next(); // s muss t enthaalen
        int count = 0;
        int min = 9999;
        for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        }
        if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        String t = in.next(); // s muss t enthaalen
        int count = 0;
        int min = 9999;
        for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        }
        if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min);
    }
} Main

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        String t = in.next(); // s muss t enthaalen
        int count = 0;
        int min = 9999;
        for (int i = 0; i <= s.length()-t.length(); i++) {
            count = 0;
            for (int j = 0; j < t.length(); j++) {
                if(s.charAt(i+j)==t.charAt(j)){
                    
                } else {
                    count++;
                    
                }
   
            }
            if(min>count){
                min = count;
            }
        }
        if(s.contains(t)){
            System.out.println(0);
        } else
        System.out.println(min);
    }
}
