jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b string
	fmt.Scan(&a, &b)

  if a == b{
		println("H")
	} else {
		println("D")
	}
}
//  [go]
package main

import (
	"fmt"
)

// 以下の問題
// https://atcoder.jp/contests/abc056/tasks/abc056_a

func main() {
	var a, b string
	fmt.Scan(&a, &b)

	// if a == "H" {
	// 	if b == "H" {
	// 		fmt.Println("H")
	// 	} else {
	// 		fmt.Println("D")
	// 	}
	// } else {
	// 	if b == "H" {
	// 		fmt.Println("D")
	// 	} else {
	// 		fmt.Println("H")
	// 	}
	// }
	
	if a == b{
		println("H")
	} else {
		println("D")
	}
}
//  [go]
package main

import "fmt"

func main() {
	var a, b string
	fmt.Scan(&a, &b)
	s := "H"
	if a != b {
		fmt.Println("D")
	}
	fmt.Println(s)
}
//  [ruby]
a,b = gets.split; puts  a == b ? 'H' : 'D'
//  [ruby]
a, b = gets.split(" ")
if a == "H"
  puts b
else
  puts b == "H" ? "D" : "H"
end
//  [ruby]
ab = gets.chomp.split
a = ab[0]
b = ab[1]
case a
when "H"
    puts b == "H" ? "H" : "D"
when "D"
    puts b == "H" ? "D" : "H"
end
//  [ruby]
a, b = gets.chomp.split(" ")
puts a == "H" ? "H" : "D"
//  [ruby]
a, b = gets.chomp.split
ans = (a == "H" ^ b == "H") ? "D" : "H"

puts ans
//  [ruby]
a, b = gets.split
puts a == b ? : 'H' : 'D'
//  [rust]
use std::cmp::*;
use std::io::*;
use std::num::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin
        .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 mut a: String = read();
    let mut b: String = read();
    let aa: bool = a.pop().unwrap() == 'H';
    let bb: bool = b.pop().unwrap() == 'H';
    println!("{}", if !aa ^ bb { "H" } else { "D" })
}
//  [rust]

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

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: String = read();
    let b: String = read();
    let mut ans: String = "".to_string();
    if a == "H" {
        if b == "H" {
            ans = "H".to_string();
        } else { 
            ans = "D".to_string();
        }
    } else {
        if b == "H" {
            ans = "D".to_string();
        } else { 
            ans = "H".to_string();
        }
    }
    println!("{}", ans);
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇

    let a = io.chars()[0];
    let b = io.chars()[0];

    let ans = (a == 'H') ^ (b != 'H');
    io.writeln(if ans { "H" } else { "D" });
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇

    let a = io.read::<char>();
    let b = io.read::<char>();

    let ans = (a == 'H') ^ (b != 'H');
    io.writeln(if ans { "H" } else { "D" });
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇

    let ab = io.readn::<char>(2);

    let ans = (ab[0] == 'H') ^ (ab[1] != 'H');
    io.writeln(if ans { "H" } else { "D" });
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        a:char,
        b:char
    }
    if a == b{
        println!("H");
    }else{
        println!("D");
    }
}
//  [swift]
let i=readLine()!.characters.split(" ").map{String($0)};print(i[0]==i[1] ?"H":"D")
//  [swift]
let i=readLine()!.characters.split(" ");print(i[0]==i[1] ?"H":"D")
//  [typescript]
const main = (input) => {
  input = input.trim();
  input = input.split(' ');
  const a = input[0];
  const b = input[1];
  
  if (a=="H" && b=="H") {
    console.log("H");
  }else if (a=="D" && b=="D"){
    console.log("H");
  }else{
    console.log("D");
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  out(sin()==sin()?'H':'D')
}
main()
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  out(ssin()==ssin()?'H':'D')
}
main()
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const a = input[0];
  const b = input[1];
  
  if (a=="H" && b=="H") {
    console.log("H");
  }else if (a=="D" && b=="D"){
    console.log("H");
  }else{
    console.log("D");
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const a = input[0];
  const b = input[1];
  
  if (a=='H' && b=='H') {
    console.log('H');
  }else if (a=='D' && b=='D'){
    console.log('H');
  }else{
    console.log('D');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
def main():
    s = input()
    t = input()
    ans = 0
    substr = ''
    len_s = len(s)
    len_t = len(t)
    if t in s:
        print(0)
    else:
        for i in range(len_s - len_t + 1):
            substr = s[i: i + len_t]
            tmp = 0
            for sn, tn in zip(substr, t):
                if sn == tn:
                    tmp += 1
            ans = max(ans, tmp)
            if ans == len_t - 1:
                break
        print(len(t) - ans)


if __name__ == '__main__':
    main()
//  [python]
def main(S, T):
    score = float('inf')
    org_length = len(S)
    part_length = len(T)

    for i in range(0, org_length - part_length + 1):
        part_str = S[i:i + part_length]

        count = 0
        for a, b in zip(part_str, T):
            if a != b:
                count+=1
        score = min(count, score)

    print(score)


if __name__ == '__main__':
    S = input()
    T = input()
    main(S, T)
//  [python]
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 19 + 7
EPS = 10 ** -10

S = list(input())
T = list(input())
N = len(S)
M = len(T)

def check(S, T):
    res = 0
    for i in range(M):
        if S[i] != T[i]:
            res += 1
    return res

ans = INF
for i in range(N-M+1):
    ans = min(ans, check(S[i:i+M], T))
print(ans)
//  [python]
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools as fts
import itertools as its
import math
import sys

INF = float('inf')


def solve(S: str, T: str):
    return len(T) - max(sum(s == t for s, t in zip(S[i:], T)) for i in range(len(S) - len(T)))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    print(f'{solve(S, T)}')


if __name__ == '__main__':
    main()
//  [python]
S=[i for i in input()]
T=[j for j in input()]
ans=[]
for i in range(len(S)-len(T)):
  count=0
  new_S=[t for t in S[i:]]
  for j,k in zip(new_S,T):
    if j==k:
      count+=1
  else:
    ans.append(count)
    
print(len(T)-max(ans))
//  [python]
s = input()
t = input()

max_count = 0
for i in range(len(s) - len(t)):
  count = 0
  for j in range(len(t)):
    if t[j] == s[i + j]:
      count += 1
  if max_count < count:
    max_count = count
print(len(t) - max_count)
//  [java]
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        char[] t = br.readLine().toCharArray();
        int minCount = t.length, count = 0;
        for(int i=0; i<=s.length-t.length; i++) {
            int temp = 0;
            count = 0;
            while(temp < t.length) {
                if(s[temp+i] != t[temp])
                    count++;
                temp++;
            }
            minCount = Math.min(minCount, count);
        }
        System.out.println(minCount);
        br.close();
    }
}
//  [java]
import java.io.BufferedReader;
import java.util.*;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import java.util.StringTokenizer;

 
public class Main {
	public static void main(String[] args) {
		FastScanner fs=new FastScanner();
		String s,t;
		s = fs.next();
		t = fs.next();
		int n = s.length();
		int m = t.length();
		int ans = Integer.MAX_VALUE;
		for(int i=0;i+m-1<n;i++) {
			int chn =0;
			for(int j=0;j<m;j++) {
				chn += (s.charAt(i+j)!=t.charAt(j))?1:0;
			}
			ans = Math.min(ans,chn);
		}
		System.out.println(ans);
		
	}
	static final Random random=new Random();
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
 
	
}
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=a-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }
        
		System.out.println(ans);
	}
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String t = scan.next();

		int ans = t.length();

		for (int i = 0; i <s.length()-t.length(); i++) {
			int diff=0;
			for (int j = 0; j < t.length(); j++) {
				if(s.charAt(i+j) != t.charAt(j) ) {
					diff++;
				}
			}
			ans = Math.min(ans,diff);
		}

		System.out.println(ans);


	}

}
//  [java]
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        
        String question = scanner.next();
        String answer = scanner.next();
        
        int count = 0;
        int min = answer.length();
        for(int i=0;i<question.length()-answer.length();i++){
            for(int j=0;j<answer.length();j++){
            if(question.charAt(i+j) != answer.charAt(j)){
                count++;
            }
            }
            
            if(min > count)min = count;
            count=0;
        }
        
        System.out.print(min);
    }
}
//  [cpp]
#include<cstdio>
#include<algorithm>
#include<functional>
#include<cstring>
#include<queue>
using namespace std;

int main(void)
{
	int ls,lt,i,j,cnt,mn;
	char s[1001],t[1001];
	scanf("%s",s);
	scanf("%s",t);
	ls=strlen(s);
	lt=strlen(t);
	mn=10000;
	for(i=0;i<ls-lt+1;i++)	{
		cnt=0;
		for(j=0;j<lt;j++)	{
			if(s[i+j]!=t[j])	cnt++;
		}
		mn=min(cnt,mn);
	}
	printf("%d\n",mn);
	return 0;
}
//  [cpp]
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
#define PI 3.141592653589793

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){
  string s, t; cin >> s >> t;
  int n = s.size(); int m = t.size();
  int ans = inf;
  rep(i, n-m+1){
    int cnt = 0;
    rep(j, m){
      if(s[i+j]==t[j]) continue;
      else cnt++;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int mod = (int)1e9+7;
#define REP0(i,n) for(int i=0;i<n;i++)
#define REP(i,a,n) for(int i=a;i<=n;i++)
#define F first
#define S second
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define setbits(x) __builtin_popcountll(x)
#define inf (int)(1e18)
#define prec(x) fixed<<setprecision(x)<<x
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define all(x) x.begin(),x.end()


const int d4i[4]={-1, 0, 1, 0}, d4j[4]={0, 1, 0, -1};
const int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};

void solve(){
   string s,t;
   cin>>s>>t;
   int m = s.size();
   int n = t.size();
   int ml = INT_MAX;  
   for(int i=0;i<m-n+1;i++){
       int len = 0;
       for(int j=0;j<n;j++){
           if(s[i+j] != t[j]){
               ++len;
           }
       }
       ml = min(ml,len);
   }
   cout<<ml<<endl;
}


int main(){
    fastio;
    #ifndef ONLINE_JUDGE
        //freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif
    int tc = 1;
    // cin>>tc;
    for(int i=1;i<=tc;i++){
        solve();
    }
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int main(){
  string s,t;
  cin >> s >> t;
  int ans = t.length();
  for(int i = 0; i < s.length() - t.length(); i++){
    int diff = 0;
   	for(int j = 0; j < t.length(); j++){
      if(s[i+j] != t[j])
        diff++;
    }
    ans = min(ans, diff);
  }
  cout << ans;
  return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s,t;
  cin>>s>>t;
  string a = "abcdefghijklmnopqrstuvwxyz";
  int i,j,ans =0 ,ii,ij,c=0;
  for(i=0;i<= s.length()-t.length();i++)
  {
      for(j=0;j<t.length();j++)
      {
          ii=i;
          //ij=j;
          if(s[ii++] == t[j])
            c++;
      }
      ans = max(ans,c);
      c=0;
  }



  cout<<t.length()-ans;
  return 0;
}
//codeforces
//atcoder
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s,t;
  cin>>s>>t;
  string a = "abcdefghijklmnopqrstuvwxyz";
  int i,j,ans =0 ,ii,ij,c=0;
  for(i=0;i< s.length()-t.length();i++)
  {
      for(j=0;j<t.length();j++)
      {
          ii=i;
          //ij=j;
          if(s[ii++] == t[j])
            c++;
      }
      ans = max(ans,c);
      c=0;
  }



  cout<<t.length()-ans;
  return 0;
}
//codeforces
//atcoder
//  [c]
#include <stdio.h>
#include <string.h>

int main(void)
{

    int start, ans, diff;
    int i;
    int s, t;
    char S[1000], T[1000];

    scanf("%s", S);
    scanf("%s", T);

    s = strlen(S);
    t = strlen(T);

    ans = s;

    for (start = 0; start <= s - t; start++)
    {
        diff = 0;
        for (i = 0; i < t; i++)
        {
            if (T[i] != S[start + i])
            {
                diff++;
            }
            
        }
        if (ans > diff)
        {
            ans = diff;
        }
        
    }

    printf("%d",ans);

    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main (void)
{
    char s[1005];
    char t[1005];
    int lens;
    int lent;
    int cnt=0;
    int ans;
    int i;
    int j;

    scanf("%s",s);
    lens = strlen(s);
    scanf("%s",t);
    lent = strlen(t);
    ans = lent;

    // printf("%d, %d", lens, lent);

    for(i=0;i<(lens-lent+1);i++){
        for(j=0;j<lent;j++){
            if(s[i+j]!=t[j]){
                cnt++;
            }
        }
        if(cnt < ans){
            ans = cnt;
        }
        cnt = 0;
    }

    printf("%d",ans);
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(){
        char s[1001], t[1001], kiri[1001];
        int n, m;
        scanf("%s%s", s, t);
        n=strlen(s); m=strlen(t);

        int i, j, min, diff;
        min=m;
        for(i=0; i<=n-m; i++){
                diff=0;
                for(j=0; j<m; j++){
                        if(t[j]!=s[i+j]){
                                diff++;
                        }
                }
                if(min>diff){
                        min=diff;
                }
        }
        printf("%d", min);


        return 0;
}
//  [c]
#include <bits/stdc++.h>
using namespace std;;
 
int main(){
	
    string s, t;
    int sSize, tSize, ans, count;
    
    cin >> s >> t;
    
    sSize = s.size();
    tSize = t.size();
    
    ans = tSize;
    
    for (int i = 0; i <= sSize-tSize; i++){
        count = 0;
        for (int j = 0; j < tSize; j++){
            if (s[i + j] != t[j]){
                count++;
            }
        }
        ans = min(ans, count);
    }
    cout << ans << endl;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main() {
  char S[1001], T[1001];
  
  scanf("%s", S);
  scanf("%s", T);
  
  int min = strlen(T);
  for(int i=0; i<strlen(S) - strlen(T); i++) {
    int counter = 0;
    for(int j=0; j<strlen(T); j++) {
      if(S[i+j] != T[j]) counter++;
    }
    if(min > counter)
      min = counter;
  }
  
  printf("%d", min);
  return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main() {
  char S[1001], T[1001];
  
  scanf("%s", S);
  scanf("%s", T);
  
  int min = 1000;
  int s_len = strlen(S);
  int t_len = strlen(T);
  
  int i_max = s_len-t_len;
  for(int i=0; i<i_max; i++) {
    int counter = 0;
    for(int j=0; j<t_len; j++) {
      if(S[i+j] != T[j]) counter++;
    }
    if(min > counter)
      min = counter;
  }
  
  printf("%d", min);
  return 0;
}
//  [javascript]
function Main(input) {
  input = input.replace(/\n/g, ' ').split(" ");
  var a = input[0];
  var b = input[1];
  var ans = 10000000;
  for(var i=0;i<a.length-(b.length-1);i++){
    var p = 0;
    for(var l=0;l<b.length;l++){
      var t =a.charAt(i+l);
      var s =b.charAt(l);
      if(t!=s)p++;
    }
    if(ans>p)ans=p;
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
    let s = (input.split("\n")[0]).split("");
    let t = (input.split("\n")[1]).split("");
    let ans = t.length ;
    for(let a = 0; a <= s.length - t.length; a++){
        let diff = 0;
        for(let b = 0; b < t.length; b++){
            if(t[b] != s[a+b]){
                diff++;
            }
        }
        ans = Math.min(diff, ans);
    }
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
console.log((args=>{
  const [S,T] = args.trim().split`\n`;
  const sl = S.length, tl = T.length;
  let min = tl;
  for ( let i = 0; i <= sl-tl; i++ ) {
    let count = 0;
    for ( let j = 0; j < tl; j++ ) {
      if ( S[i+j] !== T[j] ) count++;
    }
    if ( min > count ) min = count;
  }
  return min;
})(require('fs').readFileSync('/dev/stdin','utf8')));
//  [javascript]
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let s = next()
    let t = next()
    let ans = t.length
    for(let i = 0; i<s.length; i++){
        let tmp = t.length 
        for(let j = 0; j<t.length; j++){
            if(s[i+j] == t[j]){
                tmp--
            }
        }
        ans = Math.min(ans, tmp)
    }
    console.log(ans)
    return
}
Main()
//  [javascript]
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let s = next()
    let t = next()
    let ans = t.length
    for(let i = 0; i<s.length; i++){
        let tmp = t.length 
        for(let j = 0; j<t.length; j++){
            if(s[i+j] !== t[j]){
                tmp--
            }
        }
        ans = Math.min(ans, tmp)
    }
    console.log(ans)
    return
}
Main()
//  [javascript]
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let s = next()
    let t = next()
    let ans = t.length
    for(let i = 0; i<s.length; i++){
        let tmp = 0 
        for(let j = 0; j<t.length; j++){
            if(s[i+j] !== t[j]){
                tmp++
            }
        }
        ans = Math.min(ans, tmp)
    }
    console.log(ans)
    return
}
Main()
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func min(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v < ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	s, t := next(), next()

	ans := len(t)
	for i := 0; i <= len(s)-len(t); i++ {
		need := 0
		for j := 0; j < len(t); j++ {
			if s[i+j] != t[j] {
				need++
			}
		}
		ans = min(ans, need)
	}

	puts(ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

var sc *bufio.Scanner

const bufferSize = 1024

func nextString() string {
	if !sc.Scan() {
		panic(nil)
	}
	return sc.Text()
}

var production bool

func debugf(format string, v ...interface{}) {
	if !production {
		fmt.Printf(format, v...)
	}
}

func answer(reader io.Reader, writer io.Writer) {
	sc = bufio.NewScanner(reader)
	buf := make([]byte, bufferSize)
	sc.Buffer(buf, 1e+7)
	sc.Split(bufio.ScanWords)
	s := nextString()
	t := nextString()

	ans := len(t)
	for i := 0; i < len(s)-len(t)+1; i++ {
		a := len(t)
		for j := 0; j < len(t); j++ {
			if s[i+j] == t[j] {
				a--
			}
		}
		if a < ans {
			ans = a
		}
	}

	_, _ = fmt.Fprintf(writer, "%d", ans)
}

func main() {
	production = true
	answer(os.Stdin, os.Stdout)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strings"
)

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	s, t := io.Next(), io.Next()
	min := math.MaxInt64
	for i := 0; i+len(t) <= len(s); i++ {
		cnt := countDiff(s[i:i+len(t)], t)
		if cnt < min {
			min = cnt
		}
	}
	io.Println(min)
}

func countDiff(s, t string) int {
	cnt := 0
	for i := range s {
		if s[i] != t[i] {
			cnt++
		}
	}
	return cnt
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func min(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v < ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	s, t := next(), next()

	ans := len(t)
	for i := 0; i < len(s)-len(t); i++ {
		need := 0
		for j := 0; j < len(t); j++ {
			if s[i+j] != t[j] {
				need++
			}
		}
		ans = min(ans, need)
	}

	puts(ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

var sc *bufio.Scanner

const bufferSize = 1024

func nextString() string {
	if !sc.Scan() {
		panic(nil)
	}
	return sc.Text()
}

var production bool

func debugf(format string, v ...interface{}) {
	if !production {
		fmt.Printf(format, v...)
	}
}

func answer(reader io.Reader, writer io.Writer) {
	sc = bufio.NewScanner(reader)
	buf := make([]byte, bufferSize)
	sc.Buffer(buf, 1e+7)
	sc.Split(bufio.ScanWords)
	s := nextString()
	t := nextString()

	ans := len(t)
	for i := 0; i < len(s)-len(t); i++ {
		a := len(t)
		for j := 0; j < len(t); j++ {
			if s[i+j] == t[j] {
				a--
			}
		}
		if a < ans {
			ans = a
		}
	}

	_, _ = fmt.Fprintf(writer, "%d", ans)
}

func main() {
	production = true
	answer(os.Stdin, os.Stdout)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	s := next()
	t := next()

	sl := len(s)
	tl := len(t)
	ans := sl
	for i := 0; i < sl-tl; i++ {
		tmp := count(s[i:i+tl], t)
		if tmp < ans {
			ans = tmp
		}
	}

	fmt.Println(ans)
}

func count(s, t string) int {
	ch := len(s)
	for i := 0; i < len(s); i++ {
		if s[i:i+1] == t[i:i+1] {
			ch--
		}
	}
	return ch
}
//  [ruby]
S = gets.chomp
T = gets.chomp

s_n = S.chars
t_n = T.chars
s_l = s_n.length
t_l = t_n.length
ans = t_l
(0..(s_l-t_l)).each do |i|
  count = 0
  (0..t_l-1).each do |j|
    count += 1 if s_n[i+j] != t_n[j]
  end
  ans = [ans, count].min
end

p ans
//  [ruby]
s = gets.chomp.split("")
t = gets.chomp.split("")

result = t.length
s.each_cons(t.length) do |arr|
  tmp = t.length
  (0..t.length-1).each do |i|
    tmp -= 1 if arr[i] == t[i]
  end
  result = tmp if tmp < result
end

puts result
//  [ruby]
s=gets.chomp.split("").map(&:to_s)
v=gets.chomp.split("").map(&:to_s)

count=Array.new(v.length){0}
for i in 0..(s.length-v.length)
    vv=s[i..i+v.length-1]

    check=0
    for j in 0..vv.length-1
        if vv[j]==v[j]
            check+=1
        end
        
    end
    count[i]=check
  
end
p v.length-count.max
//  [ruby]
s = gets.split("")
t = gets.split("")
n = 0
m = 0
cnt = 0
res = []

while n <= (s.length - t.length) do
  t.length.times do
    if s[n+m] == t[m]
      cnt += 1
    end
    m += 1
  end
  n += 1
  m = 0
  res << cnt
  cnt = 0
end

puts t.length - res.max
//  [ruby]
s = gets.split("")
t = gets.split("")
n = 0
m = 0
cnt = 0
res = []

while n <= (s.length - t.length) do
  t.length.times do
    if s[n+m] == t[m]
      cnt += 1
    end
    m += 1
  end
  n += 1
  m = 0
  res << cnt
  cnt = 0
end

puts t - res.max
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
  }
  
  macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
  
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
  }
  
  macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
  
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
  
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
  
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
  
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
  }

use std::cmp::max;
fn main() {
    input!{
        s: chars,
        t: chars,
    }
    let mut ans = 0;
    let d = s.len() - t.len();
    for i in 0..d+1 {
        let mut count = 0;
        for j in 0..t.len() {
            if s[i+j] == t[j] {
                count += 1;
            }
        }
        ans = max(count,ans);
    }
    println!("{}",t.len() - ans);
}
//  [rust]
use proconio::{fastout, input, marker::Chars};

#[fastout]
fn main() {
    input! {
        s: Chars,
        t: Chars,
    }

    let n = s.len();
    let m = t.len();
    let mut ans = std::i64::MAX;

    for i in 0..n - m + 1 {
        let mut count = 0;
        for j in 0..m {
            if s[i + j] != t[j] {
                count += 1;
            }
        }
        if count < ans {
            ans = count;
        }
    }

    println!("{}", ans)
}
//  [rust]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    // solver code...
    let s_tmp = read::<String>();
    let t_tmp = read::<String>();

    let s: Vec<char> = s_tmp.chars().collect();
    let t: Vec<char> = t_tmp.chars().collect();
    let mut min_count = s.len() + 1;
    let range: usize = s.len() - t.len() + 1;
    for i in 0..range {
        let mut tmp_count = 0;
        for j in 0..t.len() {
            if s[i+j] != t[j] {
                tmp_count += 1;
            }
        }
        min_count = std::cmp::min(min_count, tmp_count);
    }
    println!("{}", min_count);
}
//  [rust]
fn b() {
    input!{
        s: Chars,
        t: Chars,
    }

    let mut ans = std::usize::MAX;

    for i in 0..(s.len() - t.len()) {
        let mut count = 0;
        for j in 0..t.len() {
            if s[i + j] != t[j] {
                count += 1;
            }
        }
        if ans > count {
            ans = count;
        }
    }
    println!("{}", ans);
}

use proconio::{input, marker::Chars};

fn main() {
    b();
}
//  [rust]
fn b() {
    input!{
        s: Chars,
        t: Chars,
    }

    let mut ans = usize::MAX;

    for i in 0..(s.len() - t.len()) {
        let mut count = 0;
        for j in 0..t.len() {
            if s[i + j] != t[j] {
                count += 1;
            }
        }
        if ans > count {
            ans = count;
        }
    }
    println!("{}", ans);
}

use proconio::{input, marker::Chars};

fn main() {
    b();
}
//  [rust]
use proconio::*;

fn main() {
    input! {s: String, t: String}
    let (s, t) : (String, String) = (s, t);
    let (s_chars, t_chars): (Vec<char>,Vec<char>) = (s.chars().collect(), t.chars().collect());
    let mut max = 0;
    let mut count = 0;
    for i in 0.. s_chars.len() - t_chars.len() {
        for j in 0.. t_chars.len() {
            if s_chars[i+j] == t_chars[j]{
                count += 1;
            }             
        }
        if count > max { max = count; }
        count = 0;
    }
    println!("{}", t_chars.len() - max);
}
//  [swift]
func main2(text1: [Character] = Array(readLine()!), text2: [Character] = Array(readLine()!)) {
    let text2Count = text2.count
    var result = text2Count
    for index in text1.startIndex...(text1.endIndex - text2Count) {
        var difference = 0
        for (character1, character2) in zip(text1[index...], text2) where character1 != character2 {
            difference += 1
        }
        if result > difference {
            result = difference
        }
    }
    print(result)
}

main2()
//  [swift]
import Foundation
let s = readLine()!
let t = readLine()!

if t.isEmpty {
  print(s.isEmpty ? 0 : -1)
  exit(0)
}

let S = Array(s)
let T = Array(t)

var ans = T.count

func diff(_ S: [Character], _ T: [Character], _ index: Int) -> Int {

  var diff = 0
  for i in 0..<T.count {
    if T[i] != S[index + i] {
      diff += 1
    }
  }
  
  return diff
}

for i in 0...S.count - T.count {
  ans = min(ans, diff(S, T, i))
  if ans == 0 {
    break
  }
}

print(ans)
//  [swift]
func main(text1: String = readLine()!, text2: String = readLine()!) {
    let text2Indices = text2.indices
    let text2Count = text2.count
    var result = text2Count
    for text1Index in text1.indices {
        if text1[text1Index...].count < text2Count { break }
        var counter = 0
        for (i, j) in zip(text1[text1Index...].indices, text2Indices) where text1[i] != text2[j] {
            counter += 1
        }
        if result > counter {
            result = counter
        }
    }
    print(result)
}

main()