import java.util.*;
import java.io.*;
public class Main  {
    public static void main(String args[]) {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      String s=fs.next();
      String t=fs.next();
      int l1=s.length();
      int l2=t.length();
      
      int i,j;
      char ch;
      int min=0;
      String sub;
      if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      }
      out.println(min);
        
        out.flush();
        out.close();
    }
	static void ruffleSort(int[] a) {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
}
        class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		String next() {
			while (!st.hasMoreTokens())
				try {
				st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		String nextLine(){
		    String str="";
		    try{
		        str=br.readLine();
		    }catch(IOException e){
		        e.printStackTrace(); }
		    return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	} import java.util.*; util.* java import java.io.*; io.* java public class Main  {
    public static void main(String args[]) {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      String s=fs.next();
      String t=fs.next();
      int l1=s.length();
      int l2=t.length();
      
      int i,j;
      char ch;
      int min=0;
      String sub;
      if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      }
      out.println(min);
        
        out.flush();
        out.close();
    }
	static void ruffleSort(int[] a) {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
} Main public static void main(String args[]) {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      String s=fs.next();
      String t=fs.next();
      int l1=s.length();
      int l2=t.length();
      
      int i,j;
      char ch;
      int min=0;
      String sub;
      if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      }
      out.println(min);
        
        out.flush();
        out.close();
    } main {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      String s=fs.next();
      String t=fs.next();
      int l1=s.length();
      int l2=t.length();
      
      int i,j;
      char ch;
      int min=0;
      String sub;
      if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      }
      out.println(min);
        
        out.flush();
        out.close();
    } FastScanner fs=new FastScanner(); fs new FastScanner() PrintWriter out=new PrintWriter(System.out); out new PrintWriter(System.out) String s=fs.next(); s fs.next() fs.next fs String t=fs.next(); t fs.next() fs.next fs int l1=s.length(); l1 s.length() s.length s int l2=t.length(); l2 t.length() t.length t int i i j; j char ch; ch int min=0; min 0 String sub; sub if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      } l1==l2 l1 l2 {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      } for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          } i=0; i=0 i 0 i<l1 i l1 i++ i++ i {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          } {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          } if(s.charAt(i)!=t.charAt(i))
              min++; s.charAt(i)!=t.charAt(i) s.charAt(i) s.charAt s i t.charAt(i) t.charAt t i min++ min {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      } min=l2 min l2 for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      } i=0; i=0 i 0 i<l1-l2 i l1-l2 l1 l2 i++ i++ i {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      } {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      } sub=s.substring(i,i+l2) sub s.substring(i,i+l2) s.substring s i i+l2 i l2 int c=0; c 0 for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        } j=0; j=0 j 0 j<l2 j l2 j++ j++ j {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        } {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        } if(sub.charAt(j)!=t.charAt(j))
            c++; sub.charAt(j)!=t.charAt(j) sub.charAt(j) sub.charAt sub j t.charAt(j) t.charAt t j c++ c if(c<min)
        min=c; c<min c min min=c min c out.println(min) out.println out min out.flush() out.flush out out.close() out.close out String args[] args static void ruffleSort(int[] a) {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	} ruffleSort {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	} Random random=new Random(); random new Random() int n=a.length; n a.length a a.length for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		} {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		} int oi=random.nextInt(n) oi random.nextInt(n) random.nextInt random n temp=a[oi]; temp a[oi] a oi a[oi]=a[i] a[oi] a oi a[i] a i a[i]=temp a[i] a i temp Arrays.sort(a) Arrays.sort Arrays a int[] a a class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		String next() {
			while (!st.hasMoreTokens())
				try {
				st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		String nextLine(){
		    String str="";
		    try{
		        str=br.readLine();
		    }catch(IOException e){
		        e.printStackTrace(); }
		    return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	} FastScanner BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st=new StringTokenizer(""); st new StringTokenizer("") String next() {
			while (!st.hasMoreTokens())
				try {
				st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		} next {
			while (!st.hasMoreTokens())
				try {
				st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		} while (!st.hasMoreTokens())
				try {
				st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				} !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st 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 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 int nextInt() {
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		} readArray {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		} int[] a=new int[n]; a new int[n] n for (int i=0; i<n; i++) a[i]=nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i]=nextInt(); a[i]=nextInt() a[i] a i nextInt() nextInt return a; a int n n long nextLong() {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main  {
    public static void main(String args[]) {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      String s=fs.next();
      String t=fs.next();
      int l1=s.length();
      int l2=t.length();
      
      int i,j;
      char ch;
      int min=0;
      String sub;
      if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      }
      out.println(min);
        
        out.flush();
        out.close();
    }
	static void ruffleSort(int[] a) {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
} public class Main  {
    public static void main(String args[]) {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      String s=fs.next();
      String t=fs.next();
      int l1=s.length();
      int l2=t.length();
      
      int i,j;
      char ch;
      int min=0;
      String sub;
      if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      }
      out.println(min);
        
        out.flush();
        out.close();
    }
	static void ruffleSort(int[] a) {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
} Main
import java.util.*;
import java.io.*;
public class Main  {
    public static void main(String args[]) {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      String s=fs.next();
      String t=fs.next();
      int l1=s.length();
      int l2=t.length();
      
      int i,j;
      char ch;
      int min=0;
      String sub;
      if(l1==l2)
      {
          for(i=0;i<l1;i++)
          {
              if(s.charAt(i)!=t.charAt(i))
              min++;
          }
      }
      else
      {min=l2;
      for(i=0;i<l1-l2;i++)
      {
        sub=s.substring(i,i+l2);
        int c=0;
        for(j=0;j<l2;j++)
        {
            if(sub.charAt(j)!=t.charAt(j))
            c++;
        }
        if(c<min)
        min=c;
      }
      }
      out.println(min);
        
        out.flush();
        out.close();
    }
	static void ruffleSort(int[] a) {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
}
        class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		String next() {
			while (!st.hasMoreTokens())
				try {
				st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		String nextLine(){
		    String str="";
		    try{
		        str=br.readLine();
		    }catch(IOException e){
		        e.printStackTrace(); }
		    return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}