Problem:
Score : 200 points

Problem Statement

Given are two strings S and T.

Let us change some of the characters in S so that T will be a substring of S.

At least how many characters do we need to change?

Here, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy, but not a substring of xxyxx.

Constraints

The lengths of S and T are each at least 1 and at most 1000.

The length of T is at most that of S.

S and T consist of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S
T

Output

Print the minimum number of characters in S that need to be changed.

Sample Input 1

cabacc
abc

Sample Output 1

1

For example, changing the fourth character a in S to c will match the second through fourth characters in S to T.

Since S itself does not have T as its substring, this number of changes - one - is the minimum needed.

Sample Input 2

codeforces
atcoder

Sample Output 2

6

Solution in C# (.NET Core 3.1.201) (judge verdict: Accepted)

using System;

using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        //回答
        //Console.WriteLine(Math.Ceiling((double)N / X) * T);

        //整数の入力
        //int N = int.Parse(Console.ReadLine());

        ////複数の入力
        //string[] line = Console.ReadLine().Split(' ');
        //int D = int.Parse(line[0]);
        //int T = int.Parse(line[1]);
        //int S = int.Parse(line[2]);

        //if ((double)D/S <= T)
        //{
        //    Console.WriteLine("Yes");
        //}
        //else
        //{
        //    Console.WriteLine("No");
        //}

        //文字列の入力
        string S = Console.ReadLine();
        string T = Console.ReadLine();

        int ans = T.Length;
        for (int i = 0; i < S.Length - T.Length + 1; i++)
        {
            int count = 0;
            for (int j = 0; j < T.Length; j++)
            {
                if (S[i + j] != T[j])
                {
                    count++;
                    if (count >= ans)
                    {
                        break;
                    }
                }
            }
            if (count < ans)
            {
                ans = count;
            }

            //Console.WriteLine(S.Substring(i, T.Length));
            //Console.WriteLine(count);
        }

        Console.WriteLine(ans);


        //string[] line = Console.ReadLine().Split(' ');
        //int H = int.Parse(line[0]);
        //int W = int.Parse(line[1]);

        //line = Console.ReadLine().Split(' ');
        //int Ch = int.Parse(line[0]);
        //int Cw = int.Parse(line[1]);

        //line = Console.ReadLine().Split(' ');
        //int Dh = int.Parse(line[0]);
        //int Dw = int.Parse(line[1]);

        //string[] S = new string[H];

        //for(int i = 0; i < H; i++)
        //{
        //    // line = Console.ReadLine().Split('');
        //    string line2 = Console.ReadLine();
        //    //Console.WriteLine(line2);
        //    S[i] = line2;

        //    //for(int j = 0; j < W; j++)
        //    //{
        //    //    Console.WriteLine(line2[j]);
        //    //    //Console.WriteLine(S[i][j]);
        //    //}
        //}

        //for (int i = 0; i < H; i++)
        //{
        //    for (int j = 0; j < W; j++)
        //    {
        //    }
        //}


        ///////////////////////////////////////////////
        //long N = int.Parse(Console.ReadLine());
        //string[] A = Console.ReadLine().Split(' ');

        //long h = long.Parse(A[0]);
        //long dai_sum = 0;
        //for(long i = 1; i < N; i++)
        //{
        //    long ai = long.Parse(A[i]);
        //    //Console.WriteLine("-- " + i + "--");
        //    //Console.WriteLine("dai_sum : " + dai_sum);
        //    //Console.WriteLine("h : " + h);
        //    //Console.WriteLine("a[i] : " + ai);
        //    if (ai < h)
        //    {
        //        long dai = h - ai;
        //        dai_sum += dai;
        //        //Console.WriteLine("add dai : " + dai);
        //    }
        //    else
        //    {
        //        h = ai;
        //    }
        //}

        //Console.WriteLine(dai_sum);







        //==============
        //String N = Console.ReadLine();

        //int sum = 0;
        //for(int i =0;i< N.Length; i++)
        //{
        //    //Console.WriteLine("sum : " + sum);
        //    //Console.WriteLine("N[i] : " + (N[i] - '0'));
        //    sum += N[i] - '0';

        //}

        ////Console.WriteLine("sum : " + sum);

        //if (sum % 9 == 0)
        //{
        //    Console.WriteLine("Yes");
        //}
        //else
        //{
        //    Console.WriteLine("No");
        //}
        //=============



        //スペース区切りの整数の入力
        //string[] dates = Console.ReadLine().Split(' ');
        //string[] amounts = Console.ReadLine().Split(' ');

        //double date = double.Parse(input[0]);
        //double amount = double.Parse(input[1]);

        //double date = double.Parse(input[0]);
        //double amount = double.Parse(input[1]);

        //var L2 = L.Distinct().OrderBy(o => o);
        //var L2 = L.OrderBy(o => o).ToArray();

        //string input = Console.ReadLine();
        //int b = int.Parse(input[0]);
        //int c = int.Parse(input[1]);
        //文字列の入力
        //string s = Console.ReadLine();
        //出力




    }
}