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 max = 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);
        }
        if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        }
        for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        }
        System.out.println(T.length() - max);
    }
} 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 max = 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);
        }
        if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        }
        for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        }
        System.out.println(T.length() - max);
    }
} 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 max = 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);
        }
        if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        }
        for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        }
        System.out.println(T.length() - max);
    } 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 max = 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);
        }
        if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        }
        for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        }
        System.out.println(T.length() - max);
    } 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 max = 0; max 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 if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        } S.length() == T.length() S.length() S.length S T.length() T.length T {
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        } int count = 0; count 0 for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            } int j=0; int j=0; j 0 j<T.length() j T.length() T.length T j++ j++ j {
                if(s[j] == t[j]){
                    count++;
                }
            } {
                if(s[j] == t[j]){
                    count++;
                }
            } if(s[j] == t[j]){
                    count++;
                } s[j] == t[j] s[j] s j t[j] t j {
                    count++;
                } count++ count System.out.println(T.length() - count) System.out.println System.out System System.out T.length() - count T.length() T.length T count return; for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = 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[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        } {
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        } int count = 0; count 0 for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            } int j=0; int j=0; j 0 j<T.length() j T.length() T.length T j++ j++ j {
                if(s[i+j] == t[j]){
                    count++;
                }
            } {
                if(s[i+j] == t[j]){
                    count++;
                }
            } if(s[i+j] == t[j]){
                    count++;
                } s[i+j] == t[j] s[i+j] s i+j i j t[j] t j {
                    count++;
                } count++ count if(count > max)max = count; count > max count max max = count max count System.out.println(T.length() - max) System.out.println System.out System System.out T.length() - max T.length() T.length T max 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 max = 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);
        }
        if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        }
        for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        }
        System.out.println(T.length() - max);
    }
} 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 max = 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);
        }
        if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        }
        for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        }
        System.out.println(T.length() - max);
    }
} 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 max = 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);
        }
        if(S.length() == T.length()){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[j] == t[j]){
                    count++;
                }
            }
            System.out.println(T.length() - count);
            return;
        }
        for(int i=0;i<S.length()-T.length();i++){
            int count = 0;
            for(int j=0;j<T.length();j++){
                if(s[i+j] == t[j]){
                    count++;
                }
            }
            if(count > max)max = count;
        }
        System.out.println(T.length() - max);
    }
}