import std.container;
import std.range;
import std.algorithm;
import std.array;
import std.string;
import std.conv;
import std.stdio;
import std.container;

int de(string s, string t) {
	int c;
	foreach (i;0..t.length) {
		if (s[i] != t[i]) {
			++c;
		}
	}
	return c;
}

void main() {
	auto s = readln.chomp;
	auto t = readln.chomp;

	auto m = int.max;

	while (s.length >= t.length) {
		auto r = de(s[0..t.length], t);

		if (r < m) {
			m = r;
		}

		s = s[1..$];
	}

	writeln(m);
}
