import java.util.*;

/**
 * B Main
 *
 * @date 2020.09.19
 * @author 焼き鮭 <yaki-shake@up-tri.me>
 */

public class Main {
  Scanner sc;

  public static void main(String[] args) {
    new Main().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    String[] t = sc.next().split("");

    int min = t.length;
    for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    }

    System.out.println(min);
  }
} import java.util.*; util.* java public class Main {
  Scanner sc;

  public static void main(String[] args) {
    new Main().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    String[] t = sc.next().split("");

    int min = t.length;
    for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    }

    System.out.println(min);
  }
} Main Scanner sc; sc public static void main(String[] args) {
    new Main().execute();
  } main {
    new Main().execute();
  } new Main().execute() new Main().execute new Main() String[] args args public void execute() {
    this.sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    String[] t = sc.next().split("");

    int min = t.length;
    for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    }

    System.out.println(min);
  } execute {
    this.sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    String[] t = sc.next().split("");

    int min = t.length;
    for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    }

    System.out.println(min);
  } this.sc = new Scanner(System.in) this.sc this this.sc new Scanner(System.in) String[] s = sc.next().split(""); s sc.next().split("") sc.next().split sc.next() sc.next sc "" String[] t = sc.next().split(""); t sc.next().split("") sc.next().split sc.next() sc.next sc "" int min = t.length; min t.length t t.length for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    } {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    } int cnt = 0; cnt 0 if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      } s.length - i >= t.length s.length - i s.length s s.length i t.length t t.length {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      } for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        } int j = 0; int j = 0; j 0 j < t.length j t.length t t.length j++ j++ j {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        } {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        } if (!s[i + j].equals(t[j])) {
            cnt++;
          } !s[i + j].equals(t[j]) s[i + j].equals(t[j]) s[i + j].equals s[i + j] s i + j i j t[j] t j {
            cnt++;
          } cnt++ cnt if (min > cnt) {
          min = cnt;
        } min > cnt min cnt {
          min = cnt;
        } min = cnt min cnt System.out.println(min) System.out.println System.out System System.out min public class Main {
  Scanner sc;

  public static void main(String[] args) {
    new Main().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    String[] t = sc.next().split("");

    int min = t.length;
    for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    }

    System.out.println(min);
  }
} public class Main {
  Scanner sc;

  public static void main(String[] args) {
    new Main().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    String[] t = sc.next().split("");

    int min = t.length;
    for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    }

    System.out.println(min);
  }
} Main
import java.util.*;

/**
 * B Main
 *
 * @date 2020.09.19
 * @author 焼き鮭 <yaki-shake@up-tri.me>
 */

public class Main {
  Scanner sc;

  public static void main(String[] args) {
    new Main().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    String[] s = sc.next().split("");
    String[] t = sc.next().split("");

    int min = t.length;
    for (int i = 0; i < s.length; i++) {
      int cnt = 0;
      if (s.length - i >= t.length) {
        for (int j = 0; j < t.length; j++) {
          if (!s[i + j].equals(t[j])) {
            cnt++;
          }
        }
        if (min > cnt) {
          min = cnt;
        }
      }
    }

    System.out.println(min);
  }
}
