import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		
		String ans = "";
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		
		String ans = "";
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		
		String ans = "";
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		
		String ans = "";
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc long K = Long.parseLong(sc.next()); K Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc String ans = ""; ans "" int cnt = 0; cnt 0 for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		} {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		} if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			} !S.substring(i, i + 1).equals("1") S.substring(i, i + 1).equals("1") S.substring(i, i + 1).equals S.substring(i, i + 1) S.substring S i i + 1 i 1 "1" {
				ans = S.substring(i, i + 1);
				break;
			} ans = S.substring(i, i + 1) ans S.substring(i, i + 1) S.substring S i i + 1 i 1 break; {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			} cnt++ cnt if(cnt == K) {
					ans = "1";
					break;
				} cnt == K cnt K {
					ans = "1";
					break;
				} ans = "1" ans "1" break; System.out.println(ans) System.out.println System.out System System.out ans String args[] args public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		
		String ans = "";
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		
		String ans = "";
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		
		String ans = "";
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1")) {
				ans = S.substring(i, i + 1);
				break;
			} else {
				cnt++;
				if(cnt == K) {
					ans = "1";
					break;
				}
			}
		}
		System.out.println(ans);
	}
}
