import java.io.*;
import java.util.*;

public class Main {
  private static int solve(char[] ss, char[] ts) {
    int minDiff = Integer.MAX_VALUE;
    for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    }
    return minDiff;
  }

  private static void execute(ContestReader reader, ContestWriter out) {
    char[] ss = reader.nextCharArray();
    char[] ts = reader.nextCharArray();
    out.println(solve(ss, ts));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    ContestWriter out = new ContestWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestWriter extends PrintWriter {
  ContestWriter(PrintStream printStream) {
    super(printStream);
  }

  public void printList(List<? extends Object> list) {
    for (Object object : list) {
      println(object);
    }
  }

  public void printListOneLine(List<? extends Object> list) {
    List<String> stringList = new ArrayList<>();
    for (Object object : list) {
      stringList.add(object.toString());
    }
    println(String.join(" ", stringList));
  }
}

class ContestReader {
  private static final int BUFFER_SIZE = 1024;
  
  private final InputStream stream;
  private final byte[] buffer;
  private int pointer;
  private int bufferLength;
  
  ContestReader(InputStream stream) {
    this.stream = stream;
    this.buffer = new byte[BUFFER_SIZE];
    this.pointer = 0;
    this.bufferLength = 0;
  }
  
  private boolean hasNextByte() {
    if (pointer < bufferLength) {
      return true;
    }
    
    pointer = 0;
    try {
      bufferLength = stream.read(buffer);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return bufferLength > 0;
  }
  
  private int readByte() {
    if (hasNextByte()) {
      return buffer[pointer++];
    } else {
      return -1;
    }
  }
  
  private static boolean isPrintableChar(int c) {
    return 33 <= c && c <= 126;
  }
  
  public boolean hasNext() {
    while (hasNextByte() && !isPrintableChar(buffer[pointer])) {
      pointer++;
    }
    return hasNextByte();
  }
  
  public String next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b)) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  }
  
  public String nextLine() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b) && b != 0x20) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  }
  
  public char nextChar() {
    return next().charAt(0);
  }
  
  public int nextInt() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    int n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  }
  
  public long nextLong() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    long n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public String[] nextLine(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLine();
    }
    return array;
  }
  
  public char[] nextChar(int n) {
    char[] array = new char[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextChar();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public String[][] next(int n, int m) {
    String[][] matrix = new String[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    }
    return matrix;
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public char[][] nextChar(int n, int m) {
    char[][] matrix = new char[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}

class MyAssert {
  public static void myAssert(boolean flag, String message) {
    if (!flag) {
      throw new RuntimeException(message);
    }
  }
 
  public static void myAssert(boolean flag) {
    myAssert(flag, "");
  }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
  private static int solve(char[] ss, char[] ts) {
    int minDiff = Integer.MAX_VALUE;
    for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    }
    return minDiff;
  }

  private static void execute(ContestReader reader, ContestWriter out) {
    char[] ss = reader.nextCharArray();
    char[] ts = reader.nextCharArray();
    out.println(solve(ss, ts));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    ContestWriter out = new ContestWriter(System.out);
    execute(reader, out);
    out.flush();
  }
} Main private static int solve(char[] ss, char[] ts) {
    int minDiff = Integer.MAX_VALUE;
    for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    }
    return minDiff;
  } solve {
    int minDiff = Integer.MAX_VALUE;
    for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    }
    return minDiff;
  } int minDiff = Integer.MAX_VALUE; minDiff Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    } int offset = 0; int offset = 0; offset 0 offset <= ss.length - ts.length offset ss.length - ts.length ss.length ss ss.length ts.length ts ts.length offset++ offset++ offset {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    } {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    } int diff = 0; diff 0 for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      } int i = 0; int i = 0; i 0 i < ts.length i ts.length ts ts.length i++ i++ i {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      } {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      } if (ss[i + offset] != ts[i]) {
          diff++;
        } ss[i + offset] != ts[i] ss[i + offset] ss i + offset i offset ts[i] ts i {
          diff++;
        } diff++ diff minDiff = Math.min(minDiff, diff) minDiff Math.min(minDiff, diff) Math.min Math minDiff diff return minDiff; minDiff char[] ss ss char[] ts ts private static void execute(ContestReader reader, ContestWriter out) {
    char[] ss = reader.nextCharArray();
    char[] ts = reader.nextCharArray();
    out.println(solve(ss, ts));
  } execute {
    char[] ss = reader.nextCharArray();
    char[] ts = reader.nextCharArray();
    out.println(solve(ss, ts));
  } char[] ss = reader.nextCharArray(); ss reader.nextCharArray() reader.nextCharArray reader char[] ts = reader.nextCharArray(); ts reader.nextCharArray() reader.nextCharArray reader out.println(solve(ss, ts)) out.println out solve(ss, ts) solve ss ts ContestReader reader reader ContestWriter out out public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    ContestWriter out = new ContestWriter(System.out);
    execute(reader, out);
    out.flush();
  } main {
    ContestReader reader = new ContestReader(System.in);
    ContestWriter out = new ContestWriter(System.out);
    execute(reader, out);
    out.flush();
  } ContestReader reader = new ContestReader(System.in); reader new ContestReader(System.in) ContestWriter out = new ContestWriter(System.out); out new ContestWriter(System.out) execute(reader, out) execute reader out out.flush() out.flush out String[] args args class ContestWriter extends PrintWriter {
  ContestWriter(PrintStream printStream) {
    super(printStream);
  }

  public void printList(List<? extends Object> list) {
    for (Object object : list) {
      println(object);
    }
  }

  public void printListOneLine(List<? extends Object> list) {
    List<String> stringList = new ArrayList<>();
    for (Object object : list) {
      stringList.add(object.toString());
    }
    println(String.join(" ", stringList));
  }
} ContestWriter ContestWriter(PrintStream printStream) {
    super(printStream);
  } ContestWriter {
    super(printStream);
  } super(printStream) super printStream PrintStream printStream printStream public void printList(List<? extends Object> list) {
    for (Object object : list) {
      println(object);
    }
  } printList {
    for (Object object : list) {
      println(object);
    }
  } for (Object object : list) {
      println(object);
    } Object object list {
      println(object);
    } {
      println(object);
    } println(object) println object List<? extends Object> list list public void printListOneLine(List<? extends Object> list) {
    List<String> stringList = new ArrayList<>();
    for (Object object : list) {
      stringList.add(object.toString());
    }
    println(String.join(" ", stringList));
  } printListOneLine {
    List<String> stringList = new ArrayList<>();
    for (Object object : list) {
      stringList.add(object.toString());
    }
    println(String.join(" ", stringList));
  } List<String> stringList = new ArrayList<>(); stringList new ArrayList<>() for (Object object : list) {
      stringList.add(object.toString());
    } Object object list {
      stringList.add(object.toString());
    } {
      stringList.add(object.toString());
    } stringList.add(object.toString()) stringList.add stringList object.toString() object.toString object println(String.join(" ", stringList)) println String.join(" ", stringList) String.join String " " stringList List<? extends Object> list list PrintWriter class ContestReader {
  private static final int BUFFER_SIZE = 1024;
  
  private final InputStream stream;
  private final byte[] buffer;
  private int pointer;
  private int bufferLength;
  
  ContestReader(InputStream stream) {
    this.stream = stream;
    this.buffer = new byte[BUFFER_SIZE];
    this.pointer = 0;
    this.bufferLength = 0;
  }
  
  private boolean hasNextByte() {
    if (pointer < bufferLength) {
      return true;
    }
    
    pointer = 0;
    try {
      bufferLength = stream.read(buffer);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return bufferLength > 0;
  }
  
  private int readByte() {
    if (hasNextByte()) {
      return buffer[pointer++];
    } else {
      return -1;
    }
  }
  
  private static boolean isPrintableChar(int c) {
    return 33 <= c && c <= 126;
  }
  
  public boolean hasNext() {
    while (hasNextByte() && !isPrintableChar(buffer[pointer])) {
      pointer++;
    }
    return hasNextByte();
  }
  
  public String next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b)) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  }
  
  public String nextLine() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b) && b != 0x20) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  }
  
  public char nextChar() {
    return next().charAt(0);
  }
  
  public int nextInt() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    int n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  }
  
  public long nextLong() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    long n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public String[] nextLine(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLine();
    }
    return array;
  }
  
  public char[] nextChar(int n) {
    char[] array = new char[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextChar();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public String[][] next(int n, int m) {
    String[][] matrix = new String[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    }
    return matrix;
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public char[][] nextChar(int n, int m) {
    char[][] matrix = new char[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
} ContestReader private static final int BUFFER_SIZE = 1024; BUFFER_SIZE 1024 private final InputStream stream; stream private final byte[] buffer; buffer private int pointer; pointer private int bufferLength; bufferLength ContestReader(InputStream stream) {
    this.stream = stream;
    this.buffer = new byte[BUFFER_SIZE];
    this.pointer = 0;
    this.bufferLength = 0;
  } ContestReader {
    this.stream = stream;
    this.buffer = new byte[BUFFER_SIZE];
    this.pointer = 0;
    this.bufferLength = 0;
  } this.stream = stream this.stream this this.stream stream this.buffer = new byte[BUFFER_SIZE] this.buffer this this.buffer new byte[BUFFER_SIZE] BUFFER_SIZE this.pointer = 0 this.pointer this this.pointer 0 this.bufferLength = 0 this.bufferLength this this.bufferLength 0 InputStream stream stream private boolean hasNextByte() {
    if (pointer < bufferLength) {
      return true;
    }
    
    pointer = 0;
    try {
      bufferLength = stream.read(buffer);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return bufferLength > 0;
  } hasNextByte {
    if (pointer < bufferLength) {
      return true;
    }
    
    pointer = 0;
    try {
      bufferLength = stream.read(buffer);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return bufferLength > 0;
  } if (pointer < bufferLength) {
      return true;
    } pointer < bufferLength pointer bufferLength {
      return true;
    } return true; true pointer = 0 pointer 0 try {
      bufferLength = stream.read(buffer);
    } catch (IOException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
    } IOException e {
      throw new RuntimeException(e);
    } throw new RuntimeException(e); new RuntimeException(e) {
      bufferLength = stream.read(buffer);
    } bufferLength = stream.read(buffer) bufferLength stream.read(buffer) stream.read stream buffer return bufferLength > 0; bufferLength > 0 bufferLength 0 private int readByte() {
    if (hasNextByte()) {
      return buffer[pointer++];
    } else {
      return -1;
    }
  } readByte {
    if (hasNextByte()) {
      return buffer[pointer++];
    } else {
      return -1;
    }
  } if (hasNextByte()) {
      return buffer[pointer++];
    } else {
      return -1;
    } hasNextByte() hasNextByte {
      return buffer[pointer++];
    } return buffer[pointer++]; buffer[pointer++] buffer pointer++ pointer {
      return -1;
    } return -1; -1 1 private static boolean isPrintableChar(int c) {
    return 33 <= c && c <= 126;
  } isPrintableChar {
    return 33 <= c && c <= 126;
  } return 33 <= c && c <= 126; 33 <= c && c <= 126 33 <= c 33 c c <= 126 c 126 int c c public boolean hasNext() {
    while (hasNextByte() && !isPrintableChar(buffer[pointer])) {
      pointer++;
    }
    return hasNextByte();
  } hasNext {
    while (hasNextByte() && !isPrintableChar(buffer[pointer])) {
      pointer++;
    }
    return hasNextByte();
  } while (hasNextByte() && !isPrintableChar(buffer[pointer])) {
      pointer++;
    } hasNextByte() && !isPrintableChar(buffer[pointer]) hasNextByte() hasNextByte !isPrintableChar(buffer[pointer]) isPrintableChar(buffer[pointer]) isPrintableChar buffer[pointer] buffer pointer {
      pointer++;
    } pointer++ pointer return hasNextByte(); hasNextByte() hasNextByte public String next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b)) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  } next {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b)) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  } if (!hasNext()) {
      throw new NoSuchElementException();
    } !hasNext() hasNext() hasNext {
      throw new NoSuchElementException();
    } throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() while(true) {
      int b = readByte();
      if (!isPrintableChar(b)) {
        break;
      }
      sb.appendCodePoint(b);
    } true {
      int b = readByte();
      if (!isPrintableChar(b)) {
        break;
      }
      sb.appendCodePoint(b);
    } int b = readByte(); b readByte() readByte if (!isPrintableChar(b)) {
        break;
      } !isPrintableChar(b) isPrintableChar(b) isPrintableChar b {
        break;
      } break; sb.appendCodePoint(b) sb.appendCodePoint sb b return sb.toString(); sb.toString() sb.toString sb public String nextLine() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b) && b != 0x20) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  } nextLine {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b) && b != 0x20) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  } if (!hasNext()) {
      throw new NoSuchElementException();
    } !hasNext() hasNext() hasNext {
      throw new NoSuchElementException();
    } throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() while(true) {
      int b = readByte();
      if (!isPrintableChar(b) && b != 0x20) {
        break;
      }
      sb.appendCodePoint(b);
    } true {
      int b = readByte();
      if (!isPrintableChar(b) && b != 0x20) {
        break;
      }
      sb.appendCodePoint(b);
    } int b = readByte(); b readByte() readByte if (!isPrintableChar(b) && b != 0x20) {
        break;
      } !isPrintableChar(b) && b != 0x20 !isPrintableChar(b) isPrintableChar(b) isPrintableChar b b != 0x20 b 0x20 {
        break;
      } break; sb.appendCodePoint(b) sb.appendCodePoint sb b return sb.toString(); sb.toString() sb.toString sb public char nextChar() {
    return next().charAt(0);
  } nextChar {
    return next().charAt(0);
  } return next().charAt(0); next().charAt(0) next().charAt next() next 0 public int nextInt() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    int n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  } nextInt {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    int n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  } if (!hasNext()) {
      throw new NoSuchElementException();
    } !hasNext() hasNext() hasNext {
      throw new NoSuchElementException();
    } throw new NoSuchElementException(); new NoSuchElementException() int n = 0; n 0 boolean minus = false; minus false {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    } int b = readByte(); b readByte() readByte if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      } b == '-' b '-' {
        minus = true;
      } minus = true minus true if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      } '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' {
        n = b - '0';
      } n = b - '0' n b - '0' b '0' {
        throw new NumberFormatException();
      } throw new NumberFormatException(); new NumberFormatException() while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    } true {
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    } int b = readByte(); b readByte() readByte if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      } '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' {
        n *= 10;
        n += b - '0';
      } n *= 10 n 10 n += b - '0' n b - '0' b '0' if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      } b == -1 || !isPrintableChar(b) b == -1 b -1 1 !isPrintableChar(b) isPrintableChar(b) isPrintableChar b {
        return minus ? -n : n;
      } return minus ? -n : n; minus ? -n : n minus -n n n {
        throw new NumberFormatException();
      } throw new NumberFormatException(); new NumberFormatException() public long nextLong() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    long n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  } nextLong {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    long n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  } if (!hasNext()) {
      throw new NoSuchElementException();
    } !hasNext() hasNext() hasNext {
      throw new NoSuchElementException();
    } throw new NoSuchElementException(); new NoSuchElementException() long n = 0; n 0 boolean minus = false; minus false {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    } int b = readByte(); b readByte() readByte if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      } b == '-' b '-' {
        minus = true;
      } minus = true minus true if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      } '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' {
        n = b - '0';
      } n = b - '0' n b - '0' b '0' {
        throw new NumberFormatException();
      } throw new NumberFormatException(); new NumberFormatException() while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    } true {
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    } int b = readByte(); b readByte() readByte if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      } '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' {
        n *= 10;
        n += b - '0';
      } n *= 10 n 10 n += b - '0' n b - '0' b '0' if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      } b == -1 || !isPrintableChar(b) b == -1 b -1 1 !isPrintableChar(b) isPrintableChar(b) isPrintableChar b {
        return minus ? -n : n;
      } return minus ? -n : n; minus ? -n : n minus -n n n {
        throw new NumberFormatException();
      } throw new NumberFormatException(); new NumberFormatException() public double nextDouble() {
    return Double.parseDouble(next());
  } nextDouble {
    return Double.parseDouble(next());
  } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  } next {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  } String[] array = new String[n]; array new String[n] n for (int i = 0; i < n; i++) {
      array[i] = next();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = next();
    } {
      array[i] = next();
    } array[i] = next() array[i] array i next() next return array; array int n n public String[] nextLine(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLine();
    }
    return array;
  } nextLine {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLine();
    }
    return array;
  } String[] array = new String[n]; array new String[n] n for (int i = 0; i < n; i++) {
      array[i] = nextLine();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = nextLine();
    } {
      array[i] = nextLine();
    } array[i] = nextLine() array[i] array i nextLine() nextLine return array; array int n n public char[] nextChar(int n) {
    char[] array = new char[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextChar();
    }
    return array;
  } nextChar {
    char[] array = new char[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextChar();
    }
    return array;
  } char[] array = new char[n]; array new char[n] n for (int i = 0; i < n; i++) {
      array[i] = nextChar();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = nextChar();
    } {
      array[i] = nextChar();
    } array[i] = nextChar() array[i] array i nextChar() nextChar return array; array int n n public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  } nextInt {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  } int[] array = new int[n]; array new int[n] n for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = nextInt();
    } {
      array[i] = nextInt();
    } array[i] = nextInt() array[i] array i nextInt() nextInt return array; array int n n public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  } nextLong {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  } long[] array = new long[n]; array new long[n] n for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = nextLong();
    } {
      array[i] = nextLong();
    } array[i] = nextLong() array[i] array i nextLong() nextLong return array; array int n n public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  } nextDouble {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  } double[] array = new double[n]; array new double[n] n for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      array[i] = nextDouble();
    } {
      array[i] = nextDouble();
    } array[i] = nextDouble() array[i] array i nextDouble() nextDouble return array; array int n n public char[] nextCharArray() {
    return next().toCharArray();
  } nextCharArray {
    return next().toCharArray();
  } return next().toCharArray(); next().toCharArray() next().toCharArray next() next public String[][] next(int n, int m) {
    String[][] matrix = new String[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    }
    return matrix;
  } next {
    String[][] matrix = new String[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    }
    return matrix;
  } String[][] matrix = new String[n][m]; matrix new String[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    } {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    } for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        matrix[i][j] = next();
      } {
        matrix[i][j] = next();
      } matrix[i][j] = next() matrix[i][j] matrix[i] matrix i j next() next return matrix; matrix int n n int m m public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  } nextInt {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  } int[][] matrix = new int[n][m]; matrix new int[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    } for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        matrix[i][j] = nextInt();
      } {
        matrix[i][j] = nextInt();
      } matrix[i][j] = nextInt() matrix[i][j] matrix[i] matrix i j nextInt() nextInt return matrix; matrix int n n int m m public char[][] nextChar(int n, int m) {
    char[][] matrix = new char[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    }
    return matrix;
  } nextChar {
    char[][] matrix = new char[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    }
    return matrix;
  } char[][] matrix = new char[n][m]; matrix new char[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    } {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    } for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        matrix[i][j] = nextChar();
      } {
        matrix[i][j] = nextChar();
      } matrix[i][j] = nextChar() matrix[i][j] matrix[i] matrix i j nextChar() nextChar return matrix; matrix int n n int m m public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  } nextLong {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  } long[][] matrix = new long[n][m]; matrix new long[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    } {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    } for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        matrix[i][j] = nextLong();
      } {
        matrix[i][j] = nextLong();
      } matrix[i][j] = nextLong() matrix[i][j] matrix[i] matrix i j nextLong() nextLong return matrix; matrix int n n int m m public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  } nextDouble {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  } double[][] matrix = new double[n][m]; matrix new double[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    } {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    } for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        matrix[i][j] = nextDouble();
      } {
        matrix[i][j] = nextDouble();
      } matrix[i][j] = nextDouble() matrix[i][j] matrix[i] matrix i j nextDouble() nextDouble return matrix; matrix int n n int m m public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  } nextCharArray {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  } char[][] matrix = new char[n][]; matrix new char[n][] n for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      matrix[i] = next().toCharArray();
    } {
      matrix[i] = next().toCharArray();
    } matrix[i] = next().toCharArray() matrix[i] matrix i next().toCharArray() next().toCharArray next() next return matrix; matrix int n n class MyAssert {
  public static void myAssert(boolean flag, String message) {
    if (!flag) {
      throw new RuntimeException(message);
    }
  }
 
  public static void myAssert(boolean flag) {
    myAssert(flag, "");
  }
} MyAssert public static void myAssert(boolean flag, String message) {
    if (!flag) {
      throw new RuntimeException(message);
    }
  } myAssert {
    if (!flag) {
      throw new RuntimeException(message);
    }
  } if (!flag) {
      throw new RuntimeException(message);
    } !flag flag {
      throw new RuntimeException(message);
    } throw new RuntimeException(message); new RuntimeException(message) boolean flag flag String message message public static void myAssert(boolean flag) {
    myAssert(flag, "");
  } myAssert {
    myAssert(flag, "");
  } myAssert(flag, "") myAssert flag "" boolean flag flag public class Main {
  private static int solve(char[] ss, char[] ts) {
    int minDiff = Integer.MAX_VALUE;
    for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    }
    return minDiff;
  }

  private static void execute(ContestReader reader, ContestWriter out) {
    char[] ss = reader.nextCharArray();
    char[] ts = reader.nextCharArray();
    out.println(solve(ss, ts));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    ContestWriter out = new ContestWriter(System.out);
    execute(reader, out);
    out.flush();
  }
} public class Main {
  private static int solve(char[] ss, char[] ts) {
    int minDiff = Integer.MAX_VALUE;
    for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    }
    return minDiff;
  }

  private static void execute(ContestReader reader, ContestWriter out) {
    char[] ss = reader.nextCharArray();
    char[] ts = reader.nextCharArray();
    out.println(solve(ss, ts));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    ContestWriter out = new ContestWriter(System.out);
    execute(reader, out);
    out.flush();
  }
} Main
import java.io.*;
import java.util.*;

public class Main {
  private static int solve(char[] ss, char[] ts) {
    int minDiff = Integer.MAX_VALUE;
    for (int offset = 0; offset <= ss.length - ts.length; offset++) {
      int diff = 0;
      for (int i = 0; i < ts.length; i++) {
        if (ss[i + offset] != ts[i]) {
          diff++;
        }
      }
      minDiff = Math.min(minDiff, diff);
    }
    return minDiff;
  }

  private static void execute(ContestReader reader, ContestWriter out) {
    char[] ss = reader.nextCharArray();
    char[] ts = reader.nextCharArray();
    out.println(solve(ss, ts));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    ContestWriter out = new ContestWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestWriter extends PrintWriter {
  ContestWriter(PrintStream printStream) {
    super(printStream);
  }

  public void printList(List<? extends Object> list) {
    for (Object object : list) {
      println(object);
    }
  }

  public void printListOneLine(List<? extends Object> list) {
    List<String> stringList = new ArrayList<>();
    for (Object object : list) {
      stringList.add(object.toString());
    }
    println(String.join(" ", stringList));
  }
}

class ContestReader {
  private static final int BUFFER_SIZE = 1024;
  
  private final InputStream stream;
  private final byte[] buffer;
  private int pointer;
  private int bufferLength;
  
  ContestReader(InputStream stream) {
    this.stream = stream;
    this.buffer = new byte[BUFFER_SIZE];
    this.pointer = 0;
    this.bufferLength = 0;
  }
  
  private boolean hasNextByte() {
    if (pointer < bufferLength) {
      return true;
    }
    
    pointer = 0;
    try {
      bufferLength = stream.read(buffer);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return bufferLength > 0;
  }
  
  private int readByte() {
    if (hasNextByte()) {
      return buffer[pointer++];
    } else {
      return -1;
    }
  }
  
  private static boolean isPrintableChar(int c) {
    return 33 <= c && c <= 126;
  }
  
  public boolean hasNext() {
    while (hasNextByte() && !isPrintableChar(buffer[pointer])) {
      pointer++;
    }
    return hasNextByte();
  }
  
  public String next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b)) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  }
  
  public String nextLine() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    while(true) {
      int b = readByte();
      if (!isPrintableChar(b) && b != 0x20) {
        break;
      }
      sb.appendCodePoint(b);
    }
    return sb.toString();
  }
  
  public char nextChar() {
    return next().charAt(0);
  }
  
  public int nextInt() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    int n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  }
  
  public long nextLong() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    
    long n = 0;
    boolean minus = false;
    
    {
      int b = readByte();
      if (b == '-') {
        minus = true;
      } else if ('0' <= b && b <= '9') {
        n = b - '0';
      } else {
        throw new NumberFormatException();
      }
    }
    
    while(true){
      int b = readByte();
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
        throw new NumberFormatException();
      }
    }
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public String[] nextLine(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLine();
    }
    return array;
  }
  
  public char[] nextChar(int n) {
    char[] array = new char[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextChar();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public String[][] next(int n, int m) {
    String[][] matrix = new String[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = next();
      }
    }
    return matrix;
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public char[][] nextChar(int n, int m) {
    char[][] matrix = new char[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextChar();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}

class MyAssert {
  public static void myAssert(boolean flag, String message) {
    if (!flag) {
      throw new RuntimeException(message);
    }
  }
 
  public static void myAssert(boolean flag) {
    myAssert(flag, "");
  }
}
