////////////////////////////////////////////////////
//                                                //
//  For her who keeps the fire kindling in me...  //
//                                                //
////////////////////////////////////////////////////


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException; 
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
// import java.util.Scanner;
// import java.util.Arrays;
// import java.util.ArrayList;
// import java.util.Collections; 
// import java.util.StringTokenizer;
import java.util.*;
import java.lang.Math;
import java.sql.Array;
import java.awt.Point;                            

import java.awt.geom.*;

public class Main{

    static class Node{
        int x;
        int rank;
        int level;
        int fnodecount;
        char type;

        ArrayList<Node> children = new ArrayList<Node>(); 

        public Node(int x){
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        }
    }



    static class DisjointUnionSets { 
        int[] rank, parent, ele_count; 
        int n; 
        
        // Constructor 
        public DisjointUnionSets(int n) 
        { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } 
        
        // Creates n sets with single item in each 
        void makeSet() 
        { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } 
        
        // Returns representative of x's set 
        int find(int x) 
        { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        }



        int setSize(int x){
            int par = find(x);
            return ele_count[par];
        }
        


        // Unites the set that includes x and the set 
        // that includes x 
        void union(int x, int y) 
        { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } 
    } 


    static long power(long x, long y, long p) 
    { 
        // Initialize result 
        long res = 1l;      
        
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
    
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } 



static int countGreater(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (n - leftGreater); 
} 



static int countLessEqual(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (leftGreater); 
} 


    public static void main(String args[]){
        try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
                
                
//========================================### FAST IO ###=========================================//
class FastReader 
{ 
    BufferedReader br; 
    StringTokenizer st; 

    public FastReader() 
    { 
        br = new BufferedReader(new
                    InputStreamReader(System.in)); 
    } 

    String next() 
    { 
        while (st == null || !st.hasMoreElements()) 
        { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 

    int nextInt() 
    { 
        return Integer.parseInt(next()); 
    } 

    long nextLong() 
    { 
        return Long.parseLong(next()); 
    } 

    Double nextDouble() 
    { 
        return Double.parseDouble(next());
    } 

    String nextLine() 
    { 
        String str = ""; 
        try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } 
        return str;
    } 
}
    //====================================================================================================// import java.io.BufferedReader; BufferedReader java.io import java.io.BufferedWriter; BufferedWriter java.io import java.io.FileOutputStream; FileOutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStream; OutputStream java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.PrintWriter; PrintWriter java.io import java.util.*; util.* java import java.lang.Math; Math java.lang import java.sql.Array; Array java.sql import java.awt.Point; Point java.awt import java.awt.geom.*; geom.* java.awt public class Main{

    static class Node{
        int x;
        int rank;
        int level;
        int fnodecount;
        char type;

        ArrayList<Node> children = new ArrayList<Node>(); 

        public Node(int x){
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        }
    }



    static class DisjointUnionSets { 
        int[] rank, parent, ele_count; 
        int n; 
        
        // Constructor 
        public DisjointUnionSets(int n) 
        { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } 
        
        // Creates n sets with single item in each 
        void makeSet() 
        { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } 
        
        // Returns representative of x's set 
        int find(int x) 
        { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        }



        int setSize(int x){
            int par = find(x);
            return ele_count[par];
        }
        


        // Unites the set that includes x and the set 
        // that includes x 
        void union(int x, int y) 
        { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } 
    } 


    static long power(long x, long y, long p) 
    { 
        // Initialize result 
        long res = 1l;      
        
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
    
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } 



static int countGreater(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (n - leftGreater); 
} 



static int countLessEqual(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (leftGreater); 
} 


    public static void main(String args[]){
        try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
} Main static long power(long x, long y, long p) 
    { 
        // Initialize result 
        long res = 1l;      
        
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
    
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } power { 
        // Initialize result 
        long res = 1l;      
        
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
    
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } long res = 1l; res 1l x = x % p x x % p x p while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } y > 0 y 0 { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } if((y & 1)==1) 
                res = (res * x) % p; (y & 1)==1 (y & 1) y 1 1 res = (res * x) % p res (res * x) % p (res * x) res x p y = y >> 1 y y >> 1 y 1 x = (x * x) % p x (x * x) % p (x * x) x x p return res; res long x x long y y long p p static int countGreater(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (n - leftGreater); 
} countGreater { 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (n - leftGreater); 
} int l = 0; l 0 int r = n - 1; r n - 1 n 1 int leftGreater = n; leftGreater n while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} l <= r l r { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} int m = l + (r - l) / 2; m l + (r - l) / 2 l (r - l) / 2 (r - l) r l 2 if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; arr[m] > k arr[m] arr m k { 
        leftGreater = m; 
        r = m - 1; 
    } leftGreater = m leftGreater m r = m - 1 r m - 1 m 1 l = m + 1 l m + 1 m 1 return (n - leftGreater); (n - leftGreater) n leftGreater int arr[] arr int n n int k k static int countLessEqual(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (leftGreater); 
} countLessEqual { 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (leftGreater); 
} int l = 0; l 0 int r = n - 1; r n - 1 n 1 int leftGreater = n; leftGreater n while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} l <= r l r { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} int m = l + (r - l) / 2; m l + (r - l) / 2 l (r - l) / 2 (r - l) r l 2 if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; arr[m] > k arr[m] arr m k { 
        leftGreater = m; 
        r = m - 1; 
    } leftGreater = m leftGreater m r = m - 1 r m - 1 m 1 l = m + 1 l m + 1 m 1 return (leftGreater); (leftGreater) int arr[] arr int n n int k k public static void main(String args[]){
        try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    } main {
        try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    } try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        } catch(Exception e){
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        } FastReader s = new FastReader(); s new FastReader() BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out)); w new BufferedWriter(new OutputStreamWriter(System.out)) int i i q q j j k k x x y y t t n n ind ind count count diff diff key key l l r r a a b b c c d d size size Pairer Pairer max max min min sec_max sec_max minglob minglob minloc minloc beg beg end end begl begl endr endr ld ld up up down down maxele maxele minele minele case_count; case_count long ans ans sqrt sqrt sum sum maxup maxup maxdown maxdown m m X X Y Y Q Q MOD; MOD boolean flag flag flag2 flag2 streak; streak boolean l2r; l2r double avg; avg String str1 str1 str2; str2 str1 = s.nextLine() str1 s.nextLine() s.nextLine s str2 = s.nextLine() str2 s.nextLine() s.nextLine s x = str1.length() x str1.length() str1.length str1 y = str2.length() y str2.length() str2.length str2 count = 0 count 0 min = Integer.MAX_VALUE min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                } i=0; i=0 i 0 i<=(x-y) i (x-y) x y i++ i++ i {
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                } {
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                } for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    } j=0; j=0 j 0 j<y j y j++ j++ j {
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    } {
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    } if(str1.charAt(i+j) != str2.charAt(j))
                            count++; str1.charAt(i+j) != str2.charAt(j) str1.charAt(i+j) str1.charAt str1 i+j i j str2.charAt(j) str2.charAt str2 j count++ count if(count < min)
                        min = count; count < min count min min = count min count count = 0 count 0 w.write((min)+"") w.write w (min)+"" (min) "" w.write("\n") w.write w "\n" w.close() w.close w String args[] args static class Node{
        int x;
        int rank;
        int level;
        int fnodecount;
        char type;

        ArrayList<Node> children = new ArrayList<Node>(); 

        public Node(int x){
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        }
    } Node int x; x int rank; rank int level; level int fnodecount; fnodecount char type; type ArrayList<Node> children = new ArrayList<Node>(); children new ArrayList<Node>() public Node(int x){
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        } Node {
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        } this.x = x this.x this this.x x this.type = 'f' this.type this this.type 'f' int x x static class DisjointUnionSets { 
        int[] rank, parent, ele_count; 
        int n; 
        
        // Constructor 
        public DisjointUnionSets(int n) 
        { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } 
        
        // Creates n sets with single item in each 
        void makeSet() 
        { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } 
        
        // Returns representative of x's set 
        int find(int x) 
        { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        }



        int setSize(int x){
            int par = find(x);
            return ele_count[par];
        }
        


        // Unites the set that includes x and the set 
        // that includes x 
        void union(int x, int y) 
        { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } 
    } DisjointUnionSets int[] rank rank parent parent ele_count; ele_count int n; n // Constructor 
        public DisjointUnionSets(int n) 
        { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } DisjointUnionSets { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } rank = new int[n] rank new int[n] n parent = new int[n] parent new int[n] n ele_count = new int[n] ele_count new int[n] n this.n = n this.n this this.n n makeSet() makeSet int n n // Creates n sets with single item in each 
        void makeSet() 
        { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } makeSet { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } parent[i] = i parent[i] parent i i ele_count[i] = 1 ele_count[i] ele_count i 1 // Returns representative of x's set 
        int find(int x) 
        { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        } find { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        } if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } parent[x] != x parent[x] parent x x { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } parent[x] = find(parent[x]) parent[x] parent x find(parent[x]) find parent[x] parent x return parent[x]; parent[x] parent x int x x int setSize(int x){
            int par = find(x);
            return ele_count[par];
        } setSize {
            int par = find(x);
            return ele_count[par];
        } int par = find(x); par find(x) find x return ele_count[par]; ele_count[par] ele_count par int x x // Unites the set that includes x and the set 
        // that includes x 
        void union(int x, int y) 
        { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } union { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } int xRoot = find(x) xRoot find(x) find x yRoot = find(y); yRoot find(y) find y if (xRoot == yRoot) 
                return; xRoot == yRoot xRoot yRoot return; if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } rank[xRoot] < rank[yRoot] rank[xRoot] rank xRoot rank[yRoot] rank yRoot { 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            } parent[xRoot] = yRoot parent[xRoot] parent xRoot yRoot ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot] ele_count[yRoot] ele_count yRoot ele_count[yRoot] + ele_count[xRoot] ele_count[yRoot] ele_count yRoot ele_count[xRoot] ele_count xRoot if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } rank[yRoot] < rank[xRoot] rank[yRoot] rank yRoot rank[xRoot] rank xRoot {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } parent[yRoot] = xRoot parent[yRoot] parent yRoot xRoot ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot] ele_count[xRoot] ele_count xRoot ele_count[yRoot] + ele_count[xRoot] ele_count[yRoot] ele_count yRoot ele_count[xRoot] ele_count xRoot { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } parent[yRoot] = xRoot parent[yRoot] parent yRoot xRoot ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot] ele_count[xRoot] ele_count xRoot ele_count[yRoot] + ele_count[xRoot] ele_count[yRoot] ele_count yRoot ele_count[xRoot] ele_count xRoot rank[xRoot] = rank[xRoot] + 1 rank[xRoot] rank xRoot rank[xRoot] + 1 rank[xRoot] rank xRoot 1 int x x int y y class FastReader 
{ 
    BufferedReader br; 
    StringTokenizer st; 

    public FastReader() 
    { 
        br = new BufferedReader(new
                    InputStreamReader(System.in)); 
    } 

    String next() 
    { 
        while (st == null || !st.hasMoreElements()) 
        { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 

    int nextInt() 
    { 
        return Integer.parseInt(next()); 
    } 

    long nextLong() 
    { 
        return Long.parseLong(next()); 
    } 

    Double nextDouble() 
    { 
        return Double.parseDouble(next());
    } 

    String nextLine() 
    { 
        String str = ""; 
        try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } 
        return str;
    } 
} FastReader BufferedReader br; br StringTokenizer st; st public FastReader() 
    { 
        br = new BufferedReader(new
                    InputStreamReader(System.in)); 
    } FastReader { 
        br = new BufferedReader(new
                    InputStreamReader(System.in)); 
    } br = new BufferedReader(new
                    InputStreamReader(System.in)) br new BufferedReader(new
                    InputStreamReader(System.in)) String next() 
    { 
        while (st == null || !st.hasMoreElements()) 
        { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } next { 
        while (st == null || !st.hasMoreElements()) 
        { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } while (st == null || !st.hasMoreElements()) 
        { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } IOException  e { 
                e.printStackTrace(); 
            } e.printStackTrace() e.printStackTrace e { 
                st = new StringTokenizer(br.readLine()); 
            } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() 
    { 
        return Integer.parseInt(next()); 
    } nextInt { 
        return Integer.parseInt(next()); 
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() 
    { 
        return Long.parseLong(next()); 
    } nextLong { 
        return Long.parseLong(next()); 
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next Double nextDouble() 
    { 
        return Double.parseDouble(next());
    } nextDouble { 
        return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine() 
    { 
        String str = ""; 
        try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } 
        return str;
    } nextLine { 
        String str = ""; 
        try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } 
        return str;
    } String str = ""; str "" try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } catch (IOException e) 
        { 
            e.printStackTrace(); 
        } IOException e { 
            e.printStackTrace(); 
        } e.printStackTrace() e.printStackTrace e { 
            str = br.readLine(); 
        } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main{

    static class Node{
        int x;
        int rank;
        int level;
        int fnodecount;
        char type;

        ArrayList<Node> children = new ArrayList<Node>(); 

        public Node(int x){
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        }
    }



    static class DisjointUnionSets { 
        int[] rank, parent, ele_count; 
        int n; 
        
        // Constructor 
        public DisjointUnionSets(int n) 
        { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } 
        
        // Creates n sets with single item in each 
        void makeSet() 
        { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } 
        
        // Returns representative of x's set 
        int find(int x) 
        { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        }



        int setSize(int x){
            int par = find(x);
            return ele_count[par];
        }
        


        // Unites the set that includes x and the set 
        // that includes x 
        void union(int x, int y) 
        { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } 
    } 


    static long power(long x, long y, long p) 
    { 
        // Initialize result 
        long res = 1l;      
        
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
    
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } 



static int countGreater(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (n - leftGreater); 
} 



static int countLessEqual(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (leftGreater); 
} 


    public static void main(String args[]){
        try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
} public class Main{

    static class Node{
        int x;
        int rank;
        int level;
        int fnodecount;
        char type;

        ArrayList<Node> children = new ArrayList<Node>(); 

        public Node(int x){
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        }
    }



    static class DisjointUnionSets { 
        int[] rank, parent, ele_count; 
        int n; 
        
        // Constructor 
        public DisjointUnionSets(int n) 
        { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } 
        
        // Creates n sets with single item in each 
        void makeSet() 
        { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } 
        
        // Returns representative of x's set 
        int find(int x) 
        { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        }



        int setSize(int x){
            int par = find(x);
            return ele_count[par];
        }
        


        // Unites the set that includes x and the set 
        // that includes x 
        void union(int x, int y) 
        { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } 
    } 


    static long power(long x, long y, long p) 
    { 
        // Initialize result 
        long res = 1l;      
        
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
    
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } 



static int countGreater(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (n - leftGreater); 
} 



static int countLessEqual(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (leftGreater); 
} 


    public static void main(String args[]){
        try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
} Main
////////////////////////////////////////////////////
//                                                //
//  For her who keeps the fire kindling in me...  //
//                                                //
////////////////////////////////////////////////////


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException; 
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
// import java.util.Scanner;
// import java.util.Arrays;
// import java.util.ArrayList;
// import java.util.Collections; 
// import java.util.StringTokenizer;
import java.util.*;
import java.lang.Math;
import java.sql.Array;
import java.awt.Point;                            

import java.awt.geom.*;

public class Main{

    static class Node{
        int x;
        int rank;
        int level;
        int fnodecount;
        char type;

        ArrayList<Node> children = new ArrayList<Node>(); 

        public Node(int x){
            this.x = x;
            // this.rank = 0;
            this.type = 'f';
        }
    }



    static class DisjointUnionSets { 
        int[] rank, parent, ele_count; 
        int n; 
        
        // Constructor 
        public DisjointUnionSets(int n) 
        { 
            rank = new int[n]; 
            parent = new int[n];
            ele_count = new int[n];
            this.n = n; 
            makeSet(); 
        } 
        
        // Creates n sets with single item in each 
        void makeSet() 
        { 
            for (int i = 0; i < n; i++) { 
                // Initially, all elements are in 
                // their own set. 
                parent[i] = i; 
                ele_count[i] = 1;
            } 
        } 
        
        // Returns representative of x's set 
        int find(int x) 
        { 
            // Finds the representative of the set 
            // that x is an element of 
            if (parent[x] != x) { 
                // if x is not the parent of itself 
                // Then x is not the representative of 
                // his set,

                parent[x] = find(parent[x]); 
                
                // so we recursively call Find on its parent 
                // and move i's node directly under the 
                // representative of this set 
            } 
        
            return parent[x]; 
        }



        int setSize(int x){
            int par = find(x);
            return ele_count[par];
        }
        


        // Unites the set that includes x and the set 
        // that includes x 
        void union(int x, int y) 
        { 
            // Find representatives of two sets 
            int xRoot = find(x), yRoot = find(y); 
        
            // Elements are in the same set, no need 
            // to unite anything. 
            if (xRoot == yRoot) 
                return; 
        
            // If x's rank is less than y's rank 
            if (rank[xRoot] < rank[yRoot]){ 
        
                // Then move x under y  so that depth 
                // of tree remains less 
                parent[xRoot] = yRoot;
            
                ele_count[yRoot] = ele_count[yRoot] + ele_count[xRoot];
        
            // Else if y's rank is less than x's rank 
            }else if (rank[yRoot] < rank[xRoot]) {
        
                // Then move y under x so that depth of 
                // tree remains less 
                parent[yRoot] = xRoot; 
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];
            
            } else // if ranks are the same 
            { 
                // Then move y under x (doesn't matter 
                // which one goes where) 
                parent[yRoot] = xRoot; 
        
                ele_count[xRoot] = ele_count[yRoot] + ele_count[xRoot];

                // And increment the result tree's 
                // rank by 1 
                rank[xRoot] = rank[xRoot] + 1; 
            } 
        } 
    } 


    static long power(long x, long y, long p) 
    { 
        // Initialize result 
        long res = 1l;      
        
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
    
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
    
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } 



static int countGreater(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (n - leftGreater); 
} 



static int countLessEqual(int arr[], int n, int k) 
{ 
int l = 0; 
int r = n - 1; 

// Stores the index of the left most element 
// from the array which is greater than k 
int leftGreater = n; 

// Finds number of elements greater than k 
while (l <= r) { 
    int m = l + (r - l) / 2; 

    // If mid element is greater than 
    // k update leftGreater and r 
    if (arr[m] > k) { 
        leftGreater = m; 
        r = m - 1; 
    } 

    // If mid element is less than 
    // or equal to k update l 
    else
        l = m + 1; 
} 

// Return the count of elements greater than k 
return (leftGreater); 
} 


    public static void main(String args[]){
        try{
            FastReader s = new FastReader();
            // Scanner s = new Scanner(System.in);
            BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
            int i, q, j, k, x, y, t, n, ind, count, diff, key, l, r, a, b, c, d, size, Pairer, max, min, sec_max, minglob, minloc, beg, end, begl, endr, ld, up, down, maxele, minele, case_count;
            long ans, sqrt, sum, maxup, maxdown, m, X, Y, Q, MOD;//, sum2;
            boolean flag, flag2, streak;;
            boolean l2r;

            double avg;
            String str1, str2;

        
            // t = s.nextInt();
            // for(; t>0; t--){
                
                str1 = s.nextLine();
                str2 = s.nextLine();

                x = str1.length();
                y = str2.length();

                count = 0; min = Integer.MAX_VALUE;
                for(i=0; i<=(x-y); i++){
                    for(j=0; j<y; j++){
                        if(str1.charAt(i+j) != str2.charAt(j))
                            count++;
                    }
                    if(count < min)
                        min = count;
                    count = 0;
                }


                    

                w.write((min)+"");            
                w.write("\n");
            
                    
            // }
            w.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
                
                
//========================================### FAST IO ###=========================================//
class FastReader 
{ 
    BufferedReader br; 
    StringTokenizer st; 

    public FastReader() 
    { 
        br = new BufferedReader(new
                    InputStreamReader(System.in)); 
    } 

    String next() 
    { 
        while (st == null || !st.hasMoreElements()) 
        { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 

    int nextInt() 
    { 
        return Integer.parseInt(next()); 
    } 

    long nextLong() 
    { 
        return Long.parseLong(next()); 
    } 

    Double nextDouble() 
    { 
        return Double.parseDouble(next());
    } 

    String nextLine() 
    { 
        String str = ""; 
        try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } 
        return str;
    } 
}
    //====================================================================================================//
