import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.Scanner;

import javax.swing.plaf.synth.SynthSeparatorUI;

public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String K = sc.next();
		int k = 101;
		if(K.length() <= 3) k = Integer.valueOf(K);
		
		int index0 = -1;
		
		if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		}
		
		if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		}
	}
} import java.io.File; File java.io import java.io.IOException; IOException java.io import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Deque; Deque java.util import java.util.Scanner; Scanner java.util import javax.swing.plaf.synth.SynthSeparatorUI; SynthSeparatorUI javax.swing.plaf.synth public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String K = sc.next();
		int k = 101;
		if(K.length() <= 3) k = Integer.valueOf(K);
		
		int index0 = -1;
		
		if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		}
		
		if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		}
	}
} Main public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String K = sc.next();
		int k = 101;
		if(K.length() <= 3) k = Integer.valueOf(K);
		
		int index0 = -1;
		
		if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		}
		
		if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		}
	} main {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String K = sc.next();
		int k = 101;
		if(K.length() <= 3) k = Integer.valueOf(K);
		
		int index0 = -1;
		
		if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		}
		
		if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String K = sc.next(); K sc.next() sc.next sc int k = 101; k 101 if(K.length() <= 3) k = Integer.valueOf(K); K.length() <= 3 K.length() K.length K 3 k = Integer.valueOf(K) k Integer.valueOf(K) Integer.valueOf Integer K int index0 = -1; index0 -1 1 if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		} S.charAt(0) == '1' S.charAt(0) S.charAt S 0 '1' {
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		} for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			} {
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			} if(S.charAt(i) == '1'){
					index0++;
				}else break; S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
					index0++;
				} index0++ index0 break; if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		} index0 == -1 index0 -1 1 System.out.println(S.charAt(0)) System.out.println System.out System System.out S.charAt(0) S.charAt S 0 {
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		} if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1)); k <= index0 + 1 k index0 + 1 index0 1 System.out.println(1) System.out.println System.out System System.out 1 System.out.println(S.charAt(index0+1)) System.out.println System.out System System.out S.charAt(index0+1) S.charAt S index0+1 index0 1 String[] args args public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String K = sc.next();
		int k = 101;
		if(K.length() <= 3) k = Integer.valueOf(K);
		
		int index0 = -1;
		
		if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		}
		
		if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		}
	}
} public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String K = sc.next();
		int k = 101;
		if(K.length() <= 3) k = Integer.valueOf(K);
		
		int index0 = -1;
		
		if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		}
		
		if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		}
	}
} Main
import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.Scanner;

import javax.swing.plaf.synth.SynthSeparatorUI;

public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		String K = sc.next();
		int k = 101;
		if(K.length() <= 3) k = Integer.valueOf(K);
		
		int index0 = -1;
		
		if(S.charAt(0) == '1'){
			for(int i = 0; i < S.length(); i++){
				if(S.charAt(i) == '1'){
					index0++;
				}else break;
			}
		}
		
		if(index0 == -1) System.out.println(S.charAt(0));
		else{
			if(k <= index0 + 1) System.out.println(1);
			else System.out.println(S.charAt(index0+1));
		}
	}
}