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