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());
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		}
		System.out.println(1);
	}
} 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());
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		}
		System.out.println(1);
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		}
		System.out.println(1);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = Long.parseLong(sc.next());
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		}
		System.out.println(1);
	} 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 for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		} 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") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		} {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		} if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			} !S.substring(i, i + 1).equals("1") || i == K - 1 !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" i == K - 1 i K - 1 K 1 {
				System.out.println(S.substring(i, i + 1));
				return;
			} System.out.println(S.substring(i, i + 1)) System.out.println System.out System System.out S.substring(i, i + 1) S.substring S i i + 1 i 1 return; System.out.println(1) System.out.println System.out System System.out 1 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());
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		}
		System.out.println(1);
	}
} 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());
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		}
		System.out.println(1);
	}
} 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());
		for(int i = 0; i < S.length(); i++) {
			if(!S.substring(i, i + 1).equals("1") || i == K - 1) {
				System.out.println(S.substring(i, i + 1));
				return;
			}
		}
		System.out.println(1);
	}
}
