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 count = 0;
		int maxCount = 0;

	  if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      }
		System.out.println(T.length() - maxCount);
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String S = scan.next();
		String T = scan.next();

		int count = 0;
		int maxCount = 0;

	  if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      }
		System.out.println(T.length() - maxCount);
		scan.close();
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String S = scan.next();
		String T = scan.next();

		int count = 0;
		int maxCount = 0;

	  if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      }
		System.out.println(T.length() - maxCount);
		scan.close();
	} main {

		Scanner scan = new Scanner(System.in);

		String S = scan.next();
		String T = scan.next();

		int count = 0;
		int maxCount = 0;

	  if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      }
		System.out.println(T.length() - maxCount);
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan String T = scan.next(); T scan.next() scan.next scan int count = 0; count 0 int maxCount = 0; maxCount 0 if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      } S.length() == T.length() S.length() S.length S T.length() T.length T {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  } for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			} {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			} if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				} (S.charAt(i) == T.charAt(i)) S.charAt(i) S.charAt S i T.charAt(i) T.charAt T i {
					maxCount++;
				} maxCount++ maxCount {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      } for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	} int x = 0; int x = 0; x 0 x < S.length() - T.length() x S.length() - T.length() S.length() S.length S T.length() T.length T x++ x++ x {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	} {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	} for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		} int i = 0; int i = 0; i 0 i < T.length() i T.length() T.length T i++ i++ i {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		} {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		} if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			} (S.charAt(i + x) == T.charAt(i)) S.charAt(i + x) S.charAt S i + x i x T.charAt(i) T.charAt T i {
				count++;
			} count++ count if(count > maxCount) {
			maxCount = count;
		} count > maxCount count maxCount {
			maxCount = count;
		} maxCount = count maxCount count count = 0 count 0 System.out.println(T.length() - maxCount) System.out.println System.out System System.out T.length() - maxCount T.length() T.length T maxCount scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String S = scan.next();
		String T = scan.next();

		int count = 0;
		int maxCount = 0;

	  if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      }
		System.out.println(T.length() - maxCount);
		scan.close();
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String S = scan.next();
		String T = scan.next();

		int count = 0;
		int maxCount = 0;

	  if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      }
		System.out.println(T.length() - maxCount);
		scan.close();
	}
} Main
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 count = 0;
		int maxCount = 0;

	  if(S.length() == T.length())
	  {
		  for(int i = 0; i < S.length(); i++) {
				if((S.charAt(i) == T.charAt(i)))
				{
					maxCount++;
				}
			}
	  }
	  else
	  {
      for(int x = 0; x < S.length() - T.length(); x++) {
		for(int i = 0; i < T.length(); i++) {
			if((S.charAt(i + x) == T.charAt(i)))
			{
				count++;
			}
		}
		if(count > maxCount) {
			maxCount = count;
		}
		count = 0;
      	}
      }
		System.out.println(T.length() - maxCount);
		scan.close();
	}
}