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 Rust (1.42.0) (judge verdict: Accepted)

use std::io::*;
use std::str::*;

fn read<T: FromStr>(s: &mut StdinLock) -> T {
    let s = s.by_ref().bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}


fn main() {
    let s = stdin();
    let mut s = s.lock();
    let s = &mut s;

	let st:Vec<u8> = read::<String>(s).bytes().collect();
	let tt:Vec<u8>  = read::<String>(s).bytes().collect();
	
	let mut x = Vec::<i32>::new();
	x.resize(st.len(), 0);

	let mut maxc = 0;
	for i in 0 .. st.len()-tt.len()+1 {
		for j in 0 .. tt.len() {
			if st[i+j] == tt[j] {
				x[i] += 1;
				if x[i] > maxc {
					maxc = x[i];
				}
			}
		}
	}
//	println!("maxc={}", maxc);
	println!("{}", tt.len() as i32 - maxc);
	

}