import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        char[] s = new char[S.length()];
        char[] t = new char[T.length()];
        int[] ans = new int[S.length() - T.length() + 1];
        int num = 0;
    
        for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        }
        
        for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        }
        
        int h;
        
        for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        }
        
        int min      = ans[0];
        for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        }
        
        System.out.println(min);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        char[] s = new char[S.length()];
        char[] t = new char[T.length()];
        int[] ans = new int[S.length() - T.length() + 1];
        int num = 0;
    
        for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        }
        
        for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        }
        
        int h;
        
        for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        }
        
        int min      = ans[0];
        for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        }
        
        System.out.println(min);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        char[] s = new char[S.length()];
        char[] t = new char[T.length()];
        int[] ans = new int[S.length() - T.length() + 1];
        int num = 0;
    
        for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        }
        
        for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        }
        
        int h;
        
        for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        }
        
        int min      = ans[0];
        for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        }
        
        System.out.println(min);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        char[] s = new char[S.length()];
        char[] t = new char[T.length()];
        int[] ans = new int[S.length() - T.length() + 1];
        int num = 0;
    
        for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        }
        
        for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        }
        
        int h;
        
        for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        }
        
        int min      = ans[0];
        for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        }
        
        System.out.println(min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String T = sc.next(); T sc.next() sc.next sc char[] s = new char[S.length()]; s new char[S.length()] S.length() S.length S char[] t = new char[T.length()]; t new char[T.length()] T.length() T.length T int[] ans = new int[S.length() - T.length() + 1]; ans new int[S.length() - T.length() + 1] S.length() - T.length() + 1 S.length() - T.length() S.length() S.length S T.length() T.length T 1 int num = 0; num 0 for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {        
           s[i] = S.charAt(i);
        } {        
           s[i] = S.charAt(i);
        } s[i] = S.charAt(i) s[i] s i S.charAt(i) S.charAt S i for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        } int i = 0; int i = 0; i 0 i < T.length() i T.length() T.length T i++ i++ i {        
           t[i] = T.charAt(i);
        } {        
           t[i] = T.charAt(i);
        } t[i] = T.charAt(i) t[i] t i T.charAt(i) T.charAt T i int h; h for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        } int i = 0; int i = 0; i 0 i < S.length() - T.length() + 1 i S.length() - T.length() + 1 S.length() - T.length() S.length() S.length S T.length() T.length T 1 i++ i++ i {
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        } {
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        } h = i h i num = 0 num 0 for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            } int n = 0 ; int n = 0 ; n 0 n < T.length() n T.length() T.length T n++ n++ n {        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            } {        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            } if(s[h]==t[n]){
                }else{
                num++;
                } s[h]==t[n] s[h] s h t[n] t n {
                } {
                num++;
                } num++ num h++ h ans[i] = num ans[i] ans i num int min      = ans[0]; min ans[0] ans 0 for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        } int index = 1; int index = 1; index 1 index < ans.length index ans.length ans ans.length index ++ index ++ index {
            min = Math.min(min, ans[index]);
        } {
            min = Math.min(min, ans[index]);
        } min = Math.min(min, ans[index]) min Math.min(min, ans[index]) Math.min Math min ans[index] ans index 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 sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        char[] s = new char[S.length()];
        char[] t = new char[T.length()];
        int[] ans = new int[S.length() - T.length() + 1];
        int num = 0;
    
        for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        }
        
        for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        }
        
        int h;
        
        for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        }
        
        int min      = ans[0];
        for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        }
        
        System.out.println(min);
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        char[] s = new char[S.length()];
        char[] t = new char[T.length()];
        int[] ans = new int[S.length() - T.length() + 1];
        int num = 0;
    
        for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        }
        
        for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        }
        
        int h;
        
        for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        }
        
        int min      = ans[0];
        for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        }
        
        System.out.println(min);
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        char[] s = new char[S.length()];
        char[] t = new char[T.length()];
        int[] ans = new int[S.length() - T.length() + 1];
        int num = 0;
    
        for(int i = 0;i < S.length(); i++){        
           s[i] = S.charAt(i);
        }
        
        for(int i = 0;i < T.length(); i++){        
           t[i] = T.charAt(i);
        }
        
        int h;
        
        for(int i = 0; i < S.length() - T.length() + 1; i++){
            h = i;
            num = 0;
            for(int n = 0 ; n < T.length(); n++){        
                if(s[h]==t[n]){
                }else{
                num++;
                }
                h++;
            }
            ans[i] = num;
        }
        
        int min      = ans[0];
        for (int index = 1; index < ans.length; index ++) {
            min = Math.min(min, ans[index]);
        }
        
        System.out.println(min);
    }
}