import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		
		int x = 0;
		
		for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		
		int x = 0;
		
		for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		
		int x = 0;
		
		for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		
		int x = 0;
		
		for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc int x = 0; x 0 for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		} {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		} x++ x if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			} S.charAt(i) == '1' && x < K S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' x < K x K {
				continue;
			} continue; {
				System.out.println(S.charAt(i));
				break;
			} System.out.println(S.charAt(i)) System.out.println System.out System System.out S.charAt(i) S.charAt S i break; String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		
		int x = 0;
		
		for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		
		int x = 0;
		
		for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		
		int x = 0;
		
		for(int i = 0; i < S.length(); i++) {
			x++;
			if(S.charAt(i) == '1' && x < K) {
				continue;
			} else {
				System.out.println(S.charAt(i));
				break;
			}
		}
	}
}
