import java.io.*;
import java.util.*;

class Main {
 	public static void main(String args[]) throws IOException {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      	String S = br.readLine();
      	String T = br.readLine();
      	int size = T.length();
      	int ans = Integer.MAX_VALUE;
      	for(int i=0;i<=S.length()-size;i++) {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        }
        System.out.println(ans);
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main {
 	public static void main(String args[]) throws IOException {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      	String S = br.readLine();
      	String T = br.readLine();
      	int size = T.length();
      	int ans = Integer.MAX_VALUE;
      	for(int i=0;i<=S.length()-size;i++) {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        }
        System.out.println(ans);
    }
} Main public static void main(String args[]) throws IOException {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      	String S = br.readLine();
      	String T = br.readLine();
      	int size = T.length();
      	int ans = Integer.MAX_VALUE;
      	for(int i=0;i<=S.length()-size;i++) {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        }
        System.out.println(ans);
    } main {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      	String S = br.readLine();
      	String T = br.readLine();
      	int size = T.length();
      	int ans = Integer.MAX_VALUE;
      	for(int i=0;i<=S.length()-size;i++) {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        }
        System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String S = br.readLine(); S br.readLine() br.readLine br String T = br.readLine(); T br.readLine() br.readLine br int size = T.length(); size T.length() T.length T int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i=0;i<=S.length()-size;i++) {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        } int i=0; int i=0; i 0 i<=S.length()-size i S.length()-size S.length() S.length S size i++ i++ i {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        } {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        } int tmp = i; tmp i int count = 0; count 0 for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            } int j=0; int j=0; j 0 j<T.length() j T.length() T.length T j++,i++ j++ j i++ i {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            } {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            } if(S.charAt(i) != T.charAt(j))
                    count++; S.charAt(i) != T.charAt(j) S.charAt(i) S.charAt S i T.charAt(j) T.charAt T j count++ count if(count < ans)
            	ans = count; count < ans count ans ans = count ans count i = tmp i tmp System.out.println(ans) System.out.println System.out System System.out ans String args[] args
import java.io.*;
import java.util.*;

class Main {
 	public static void main(String args[]) throws IOException {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      	String S = br.readLine();
      	String T = br.readLine();
      	int size = T.length();
      	int ans = Integer.MAX_VALUE;
      	for(int i=0;i<=S.length()-size;i++) {
          	int tmp = i;
          	int count = 0;
         	for(int j=0;j<T.length();j++,i++) {
             	 if(S.charAt(i) != T.charAt(j))
                    count++;
            }
            if(count < ans)
            	ans = count;
          	i = tmp;
        }
        System.out.println(ans);
    }
}