import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    long K = sc.nextLong();
    
    for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    }  
  }
} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    long K = sc.nextLong();
    
    for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    }  
  }
} Main public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    long K = sc.nextLong();
    
    for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    }  
  } main {
    // TODO Auto-generated method stub

    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    long K = sc.nextLong();
    
    for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    }  
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    } {
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    } if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
        System.out.println(S.charAt(i));
        break;
      } System.out.println(S.charAt(i)) System.out.println System.out System System.out S.charAt(i) S.charAt S i break; if(i == K-1){
        System.out.println("1"); 
      } i == K-1 i K-1 K 1 {
        System.out.println("1"); 
      } System.out.println("1") System.out.println System.out System System.out "1" String[] args args public class Main {

  public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    long K = sc.nextLong();
    
    for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    }  
  }
} public class Main {

  public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    long K = sc.nextLong();
    
    for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    }  
  }
} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    long K = sc.nextLong();
    
    for(int i = 0; i < K; i++){
      if(S.charAt(i) != '1'){
        System.out.println(S.charAt(i));
        break;
      }
      else if(i == K-1){
        System.out.println("1"); 
      }
    }  
  }
}
