import java.util.Scanner;

class Main{



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		long k = sc.nextLong();
		if(ss.charAt(0) != '1'){
			System.out.println(ss.charAt(0));
			return;
		}else{
			for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			}
			System.out.println(1);
			
			
		}
		
	
	}


}

class Pair implements Comparable{
	int from;		//p
	int end;		//y
	int num;
	int bango;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
}
 import java.util.Scanner; Scanner java.util class Main{



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		long k = sc.nextLong();
		if(ss.charAt(0) != '1'){
			System.out.println(ss.charAt(0));
			return;
		}else{
			for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			}
			System.out.println(1);
			
			
		}
		
	
	}


} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		long k = sc.nextLong();
		if(ss.charAt(0) != '1'){
			System.out.println(ss.charAt(0));
			return;
		}else{
			for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			}
			System.out.println(1);
			
			
		}
		
	
	} main {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		long k = sc.nextLong();
		if(ss.charAt(0) != '1'){
			System.out.println(ss.charAt(0));
			return;
		}else{
			for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			}
			System.out.println(1);
			
			
		}
		
	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String ss = sc.next(); ss sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc if(ss.charAt(0) != '1'){
			System.out.println(ss.charAt(0));
			return;
		}else{
			for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			}
			System.out.println(1);
			
			
		} ss.charAt(0) != '1' ss.charAt(0) ss.charAt ss 0 '1' {
			System.out.println(ss.charAt(0));
			return;
		} System.out.println(ss.charAt(0)) System.out.println System.out System System.out ss.charAt(0) ss.charAt ss 0 return; {
			for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			}
			System.out.println(1);
			
			
		} for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			} {
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			} if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				} ss.charAt(i) != '1' ss.charAt(i) ss.charAt ss i '1' {
					System.out.println(ss.charAt(i));
					return;
				} System.out.println(ss.charAt(i)) System.out.println System.out System System.out ss.charAt(i) ss.charAt ss i return; System.out.println(1) System.out.println System.out System System.out 1 String[] args args class Pair implements Comparable{
	int from;		//p
	int end;		//y
	int num;
	int bango;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
} Pair int from;		//p from int end;		//y end int num; num int bango; bango @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	} compareTo {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return from - otherpair.from; from - otherpair.from from otherpair.from otherpair otherpair.from Object other other Comparable
import java.util.Scanner;

class Main{



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		long k = sc.nextLong();
		if(ss.charAt(0) != '1'){
			System.out.println(ss.charAt(0));
			return;
		}else{
			for(int i = 0;i < k;i++){
				if(ss.charAt(i) != '1'){
					System.out.println(ss.charAt(i));
					return;
				}
			}
			System.out.println(1);
			
			
		}
		
	
	}


}

class Pair implements Comparable{
	int from;		//p
	int end;		//y
	int num;
	int bango;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
}

