import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    String t = br.readLine();
    br.close();
    int s_len = s.length();
    int t_len = t.length();
    int answer = t.length();
    for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    }
    System.out.println(answer);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    String t = br.readLine();
    br.close();
    int s_len = s.length();
    int t_len = t.length();
    int answer = t.length();
    for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    }
    System.out.println(answer);
  }
} Main public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    String t = br.readLine();
    br.close();
    int s_len = s.length();
    int t_len = t.length();
    int answer = t.length();
    for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    }
    System.out.println(answer);
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    String t = br.readLine();
    br.close();
    int s_len = s.length();
    int t_len = t.length();
    int answer = t.length();
    for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    }
    System.out.println(answer);
  } 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 br.close() br.close br int s_len = s.length(); s_len s.length() s.length s int t_len = t.length(); t_len t.length() t.length t int answer = t.length(); answer t.length() t.length t for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    } int s_idx = 0; int s_idx = 0; s_idx 0 s_idx <= s_len - t_len s_idx s_len - t_len s_len t_len s_idx++ s_idx++ s_idx {
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    } {
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    } int diff_cnt = 0; diff_cnt 0 for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      } int t_idx = 0; int t_idx = 0; t_idx 0 t_idx < t_len t_idx t_len t_idx++ t_idx++ t_idx {
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      } {
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      } if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++; s.charAt(s_idx + t_idx) != t.charAt(t_idx) s.charAt(s_idx + t_idx) s.charAt s s_idx + t_idx s_idx t_idx t.charAt(t_idx) t.charAt t t_idx diff_cnt++ diff_cnt answer = Math.min(answer, diff_cnt) answer Math.min(answer, diff_cnt) Math.min Math answer diff_cnt System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    String t = br.readLine();
    br.close();
    int s_len = s.length();
    int t_len = t.length();
    int answer = t.length();
    for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    }
    System.out.println(answer);
  }
} public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    String t = br.readLine();
    br.close();
    int s_len = s.length();
    int t_len = t.length();
    int answer = t.length();
    for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    }
    System.out.println(answer);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    String t = br.readLine();
    br.close();
    int s_len = s.length();
    int t_len = t.length();
    int answer = t.length();
    for(int s_idx = 0; s_idx <= s_len - t_len; s_idx++){
      int diff_cnt = 0;
      for(int t_idx = 0; t_idx < t_len; t_idx++){
        if(s.charAt(s_idx + t_idx) != t.charAt(t_idx)) diff_cnt++;
      }
      answer = Math.min(answer, diff_cnt);
    }
    System.out.println(answer);
  }
}