import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    }
  }
} Main public static void main(String[] args) {
    new Main().run();
  } main {
    new Main().run();
  } new Main().run() new Main().run new Main() String[] args args public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    }
  } run {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    }
  } try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    } catch(IOException e){
      System.err.println(e);
    } IOException e {
      System.err.println(e);
    } System.err.println(e) System.err.println System.err System System.err e {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line = in.readLine(); line in.readLine() in.readLine in long k = Long.parseLong(in.readLine()); k Long.parseLong(in.readLine()) Long.parseLong Long in.readLine() in.readLine in for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      } {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      } if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        } line.charAt(i) != '1' line.charAt(i) line.charAt line i '1' {
          System.out.println(line.charAt(i));
          return;
        } System.out.println(line.charAt(i)) System.out.println System.out System System.out line.charAt(i) line.charAt line i return; System.out.println("1") System.out.println System.out System System.out "1" public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    }
  }
} public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    }
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String line = in.readLine();
      long k = Long.parseLong(in.readLine());

      for (int i = 0; i < k; i++) {
        if(line.charAt(i) != '1') {
          System.out.println(line.charAt(i));
          return;
        }
      }

      System.out.println("1");
    }
    catch(IOException e){
      System.err.println(e);
    }
  }
}