import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int i = 0;
    while(i < K && i < S.length()){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      }
    }
    System.out.println(1);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int i = 0;
    while(i < K && i < S.length()){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      }
    }
    System.out.println(1);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int i = 0;
    while(i < K && i < S.length()){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      }
    }
    System.out.println(1);
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int i = 0;
    while(i < K && i < S.length()){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      }
    }
    System.out.println(1);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc int i = 0; i 0 while(i < K && i < S.length()){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      }
    } i < K && i < S.length() i < K i K i < S.length() i S.length() S.length S {
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      }
    } if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
        System.out.println(S.charAt(i));
        System.exit(0);
      } System.out.println(S.charAt(i)) System.out.println System.out System System.out S.charAt(i) S.charAt S i System.exit(0) System.exit System 0 {
        i++;
      } i++ i System.out.println(1) System.out.println System.out System System.out 1 String[] args args
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();

    int i = 0;
    while(i < K && i < S.length()){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        System.exit(0);
      }else{
        i++;
      }
    }
    System.out.println(1);
  }
}
