import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long k = sc.nextLong();
    String answer ="1";
    long one= 0;
    for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    }
    if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    }
    
  }

  

  
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long k = sc.nextLong();
    String answer ="1";
    long one= 0;
    for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    }
    if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    }
    
  }

  

  
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long k = sc.nextLong();
    String answer ="1";
    long one= 0;
    for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    }
    if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    }
    
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long k = sc.nextLong();
    String answer ="1";
    long one= 0;
    for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    }
    if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    }
    
  } 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 String answer ="1"; answer "1" long one= 0; one 0 for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    } int i =0; int i =0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    } {
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    } if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      } !s.substring(i,i+1).equals("1") s.substring(i,i+1).equals("1") s.substring(i,i+1).equals s.substring(i,i+1) s.substring s i i+1 i 1 "1" {
        answer = s.substring(i,i+1);
        break;
      } answer = s.substring(i,i+1) answer s.substring(i,i+1) s.substring s i i+1 i 1 break; {
        one=one+1;
      } one=one+1 one one+1 one 1 if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    } k<=one k one {
       System.out.println("1");
    } System.out.println("1") System.out.println System.out System System.out "1" {
       System.out.println(answer);
    } System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long k = sc.nextLong();
    String answer ="1";
    long one= 0;
    for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    }
    if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    }
    
  }

  

  
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long k = sc.nextLong();
    String answer ="1";
    long one= 0;
    for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    }
    if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    }
    
  }

  

  
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    long k = sc.nextLong();
    String answer ="1";
    long one= 0;
    for(int i =0;i<s.length();i++){
      if(!s.substring(i,i+1).equals("1")){
        answer = s.substring(i,i+1);
        break;
      }else{
        one=one+1;
      }
    }
    if(k<=one){
       System.out.println("1");
    }else{
       System.out.println(answer);
    }
    
  }

  

  
}
