import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char []s = sc.next().toCharArray();
		long k = sc.nextLong();
		
		int count = 0 ;
		
		for(int i = 0; i<s.length; i++) {
			if(s[i] == '1') {
				count++;
			}
			else {
				break;
			}
		}
		if(k > count)
			System.out.println(s[count]);
		if(k <= count)
			System.out.println(1);
		
	}
	

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char []s = sc.next().toCharArray();
		long k = sc.nextLong();
		
		int count = 0 ;
		
		for(int i = 0; i<s.length; i++) {
			if(s[i] == '1') {
				count++;
			}
			else {
				break;
			}
		}
		if(k > count)
			System.out.println(s[count]);
		if(k <= count)
			System.out.println(1);
		
	}
	

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

} public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char []s = sc.next().toCharArray();
		long k = sc.nextLong();
		
		int count = 0 ;
		
		for(int i = 0; i<s.length; i++) {
			if(s[i] == '1') {
				count++;
			}
			else {
				break;
			}
		}
		if(k > count)
			System.out.println(s[count]);
		if(k <= count)
			System.out.println(1);
		
	}
	

} Main
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char []s = sc.next().toCharArray();
		long k = sc.nextLong();
		
		int count = 0 ;
		
		for(int i = 0; i<s.length; i++) {
			if(s[i] == '1') {
				count++;
			}
			else {
				break;
			}
		}
		if(k > count)
			System.out.println(s[count]);
		if(k <= count)
			System.out.println(1);
		
	}
	

}
