import java.io.*;
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
// import java.io.BufferedReader;
// import java.io.IOException;
// import java.io.InputStreamReader;
// import java.util.ArrayList;
// import java.util.Arrays;
// import java.util.Collections;
// import java.util.List;
// import java.util.HashSet;
// import java.util.Set;
// import java.util.Map;
// import java.util.HashMap;

import java.math.*;

public class Main {
    private static Scanner sc;
    private static final long mod = 1000000007;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private static String getUpperAlpha(int i) {
        return String.valueOf((char) (i + 64));
    }

    /* i=1 return a */
    private static String getLowerAlpha(int i) {
        return String.valueOf((char) (i + 96));
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long[] nextLongArray(int n) throws NumberFormatException, IOException {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        }

        public int[] nextIntArray(int n) throws NumberFormatException, IOException {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        }
    }

    private void solve() {
        try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        }

    }
} import java.io.*; io.* java import java.util.*; util.* java import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.math.*; math.* java public class Main {
    private static Scanner sc;
    private static final long mod = 1000000007;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private static String getUpperAlpha(int i) {
        return String.valueOf((char) (i + 64));
    }

    /* i=1 return a */
    private static String getLowerAlpha(int i) {
        return String.valueOf((char) (i + 96));
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long[] nextLongArray(int n) throws NumberFormatException, IOException {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        }

        public int[] nextIntArray(int n) throws NumberFormatException, IOException {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        }
    }

    private void solve() {
        try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        }

    }
} Main private static Scanner sc; sc private static final long mod = 1000000007; mod 1000000007 public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    } main {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    } final Main instance = new Main(); instance new Main() sc = instance.new Scanner() sc instance.new Scanner() instance instance instance.solve() instance.solve instance final String[] args args private static String getUpperAlpha(int i) {
        return String.valueOf((char) (i + 64));
    } getUpperAlpha {
        return String.valueOf((char) (i + 64));
    } return String.valueOf((char) (i + 64)); String.valueOf((char) (i + 64)) String.valueOf String (char) (i + 64) i 64 int i i /* i=1 return a */
    private static String getLowerAlpha(int i) {
        return String.valueOf((char) (i + 96));
    } getLowerAlpha {
        return String.valueOf((char) (i + 96));
    } return String.valueOf((char) (i + 96)); String.valueOf((char) (i + 96)) String.valueOf String (char) (i + 96) i 96 int i i private void solve() {
        try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        }

    } solve {
        try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        }

    } try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        } catch (

        Exception e) {
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } String s = sc.next(); s sc.next() sc.next sc String t = sc.next(); t sc.next() sc.next sc int max = 0; max 0 for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            } int i = 0; int i = 0; i 0 i < s.length() - t.length() + 1 i s.length() - t.length() + 1 s.length() - t.length() s.length() s.length s t.length() t.length t 1 i++ i++ i {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            } {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            } int count = 0; count 0 for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                } int j = 0; int j = 0; j 0 j < t.length() j t.length() t.length t j++ j++ j {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                } {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                } if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    } s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1)) s.substring(i + j, i + j + 1).equals s.substring(i + j, i + j + 1) s.substring s i + j i j i + j + 1 i + j + 1 i j 1 t.substring(j, j + 1) t.substring t j j + 1 j 1 {
                        count++;
                    } count++ count max = Math.max(count, max) max Math.max(count, max) Math.max Math count max System.out.println(t.length() - max) System.out.println System.out System System.out t.length() - max t.length() t.length t max private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long[] nextLongArray(int n) throws NumberFormatException, IOException {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        }

        public int[] nextIntArray(int n) throws NumberFormatException, IOException {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        }
    } Scanner String[] s; s int i; i BufferedReader br; br String regex = " "; regex " " public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        } Scanner {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        } s = new String[0] s new String[0] 0 i = 0 i 0 br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        } finalize {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        } try {
                super.finalize();
            } finally {
                destruction();
            } {
                destruction();
            } destruction() destruction {
                super.finalize();
            } super.finalize() super.finalize super private void destruction() throws IOException {
            if (br != null)
                br.close();
        } destruction {
            if (br != null)
                br.close();
        } if (br != null)
                br.close(); br != null br null br.close() br.close br public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        } next {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        } if (i < s.length)
                return s[i++]; i < s.length i s.length s s.length return s[i++]; s[i++] s i++ i String st = br.readLine(); st br.readLine() br.readLine br while (st == "")
                st = br.readLine(); st == "" st "" st = br.readLine() st br.readLine() br.readLine br s = st.split(regex, 0) s st.split(regex, 0) st.split st regex 0 i = 0 i 0 return s[i++]; s[i++] s i++ i public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public long[] nextLongArray(int n) throws NumberFormatException, IOException {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        } nextLongArray {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        } long[] ret = new long[n]; ret new long[n] n for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                ret[i] = nextLong();
            } {
                ret[i] = nextLong();
            } ret[i] = nextLong() ret[i] ret i nextLong() nextLong return ret; ret int n n public int[] nextIntArray(int n) throws NumberFormatException, IOException {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        } nextIntArray {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        } int[] ret = new int[n]; ret new int[n] n for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                ret[i] = nextInt();
            } {
                ret[i] = nextInt();
            } ret[i] = nextInt() ret[i] ret i nextInt() nextInt return ret; ret int n n public class Main {
    private static Scanner sc;
    private static final long mod = 1000000007;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private static String getUpperAlpha(int i) {
        return String.valueOf((char) (i + 64));
    }

    /* i=1 return a */
    private static String getLowerAlpha(int i) {
        return String.valueOf((char) (i + 96));
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long[] nextLongArray(int n) throws NumberFormatException, IOException {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        }

        public int[] nextIntArray(int n) throws NumberFormatException, IOException {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        }
    }

    private void solve() {
        try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        }

    }
} public class Main {
    private static Scanner sc;
    private static final long mod = 1000000007;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private static String getUpperAlpha(int i) {
        return String.valueOf((char) (i + 64));
    }

    /* i=1 return a */
    private static String getLowerAlpha(int i) {
        return String.valueOf((char) (i + 96));
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long[] nextLongArray(int n) throws NumberFormatException, IOException {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        }

        public int[] nextIntArray(int n) throws NumberFormatException, IOException {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        }
    }

    private void solve() {
        try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        }

    }
} Main
import java.io.*;
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
// import java.io.BufferedReader;
// import java.io.IOException;
// import java.io.InputStreamReader;
// import java.util.ArrayList;
// import java.util.Arrays;
// import java.util.Collections;
// import java.util.List;
// import java.util.HashSet;
// import java.util.Set;
// import java.util.Map;
// import java.util.HashMap;

import java.math.*;

public class Main {
    private static Scanner sc;
    private static final long mod = 1000000007;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private static String getUpperAlpha(int i) {
        return String.valueOf((char) (i + 64));
    }

    /* i=1 return a */
    private static String getLowerAlpha(int i) {
        return String.valueOf((char) (i + 96));
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long[] nextLongArray(int n) throws NumberFormatException, IOException {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextLong();
            }
            return ret;
        }

        public int[] nextIntArray(int n) throws NumberFormatException, IOException {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++) {
                ret[i] = nextInt();
            }
            return ret;
        }
    }

    private void solve() {
        try {
            String s = sc.next();
            String t = sc.next();
            int max = 0;
            for (int i = 0; i < s.length() - t.length() + 1; i++) {
                int count = 0;
                for (int j = 0; j < t.length(); j++) {
                    if (s.substring(i + j, i + j + 1).equals(t.substring(j, j + 1))) {
                        count++;
                    }
                }
                max = Math.max(count, max);
            }
            System.out.println(t.length() - max);
        } catch (

        Exception e) {
            e.printStackTrace();
        }

    }
}
