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++ (GCC 9.2.1) (judge verdict: Accepted)

#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include<sstream>
#include<numeric>
#include<queue>
#include<cstdio>
#include<iterator>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb(x) push_back(x)
ll mod = 1e9 + 7;
ll inf = 1e9 + 7;
template<typename T, typename U>
T binpow(T a, U n) {
    if (n == 0)
        return 1;
    if (n % 2 == 1)
        return (binpow(a, n - 1) * a) % mod;
    else {
        ll b = binpow(a, n / 2) % mod;
        return (b * b) % mod;
    }
}
template<typename T>
T gcd(T a, T b) {
    if (b == 0)
        return a;
    else
        return gcd(b, a % b);
}
template<typename T>
istream& operator>>(istream& str, vector<T>& vec) {
    for (auto& w : vec) str >> w;
    return str;
}
template<typename T>
ostream& operator<<(ostream& str, vector<T>& vec) {
    for (auto& w : vec) str << w << ' ';
    return str;
}

struct segtree {
    vector<set<ll>>mn;
    vector<ll>tree;
    size_t size = 1;
    //void build(ll x, ll lx, ll rx, vector<ll>& vec);
    void build(ll size_) {
        while (size < size_) {
            size *= 2;
        }
        tree.resize(size * 2 - 1);
        mn.resize(size * 2 - 1);
    }
    void update(ll i, ll x, ll v, ll lx, ll rx) {
        if (rx - lx == 1) {
            tree[x] = v;
            return;
        }
        ll m = (lx + rx) / 2;
        if (i < m) {
            update(i, 2 * x + 1, v, lx, m);
        }
        else {
            update(i, 2 * x + 2, v, m, rx);
        }
        tree[x] = tree[2 * x + 1] + tree[2 * x + 2];
    }

    ll get(ll l, ll r, ll x, ll lx, ll rx) {
        if (l <= lx && rx <= r) return tree[x];
        if (rx <= l || lx >= r) return 0;
        ll m = (lx + rx) / 2;
        return get(l, r, 2 * x + 1, lx, m) + get(l, r, 2 * x + 2, m, rx);
    }
};



signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    string s, t;
    cin >> s >> t;
    int minn = 1e9;
    for (int i = 0; i <= s.size() - t.size(); ++i) {
        int cur = 0;
        for (int j = 0; j < t.size(); ++j) {
            if (s[i + j] != t[j])
                cur++;
        }
        minn = min(minn, cur);
    }
    cout << minn;
}