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