import java.util.*;
import java.io.*;

public class Main {

	public static void main (String[] args) {
	   Scanner sc = new Scanner(System.in) ;
	   char s[] = sc.nextLine().toCharArray();
	   long k = sc.nextLong();
	   for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   }
	   System.out.println('1'); 
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {

	public static void main (String[] args) {
	   Scanner sc = new Scanner(System.in) ;
	   char s[] = sc.nextLine().toCharArray();
	   long k = sc.nextLong();
	   for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   }
	   System.out.println('1'); 
	}
} Main public static void main (String[] args) {
	   Scanner sc = new Scanner(System.in) ;
	   char s[] = sc.nextLine().toCharArray();
	   long k = sc.nextLong();
	   for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   }
	   System.out.println('1'); 
	} main {
	   Scanner sc = new Scanner(System.in) ;
	   char s[] = sc.nextLine().toCharArray();
	   long k = sc.nextLong();
	   for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   }
	   System.out.println('1'); 
	} Scanner sc = new Scanner(System.in) ; sc new Scanner(System.in) char s[] = sc.nextLine().toCharArray(); s sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   } int i = 0; int i = 0; i 0 i<Math.min(s.length, k) i Math.min(s.length, k) Math.min Math s.length s s.length k i++ i++ i {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   } {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   } if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   } s[i] != '1' s[i] s i '1' {
			   System.out.println(s[i]);
			   return; 
		   } System.out.println(s[i]) System.out.println System.out System System.out s[i] s i return; 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) {
	   Scanner sc = new Scanner(System.in) ;
	   char s[] = sc.nextLine().toCharArray();
	   long k = sc.nextLong();
	   for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   }
	   System.out.println('1'); 
	}
} public class Main {

	public static void main (String[] args) {
	   Scanner sc = new Scanner(System.in) ;
	   char s[] = sc.nextLine().toCharArray();
	   long k = sc.nextLong();
	   for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   }
	   System.out.println('1'); 
	}
} Main
import java.util.*;
import java.io.*;

public class Main {

	public static void main (String[] args) {
	   Scanner sc = new Scanner(System.in) ;
	   char s[] = sc.nextLine().toCharArray();
	   long k = sc.nextLong();
	   for(int i = 0; i<Math.min(s.length, k); i++) {
		   if(s[i] != '1' ) {
			   System.out.println(s[i]);
			   return; 
		   }
	   }
	   System.out.println('1'); 
	}
}
