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 oneIndex = 0;
 
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		}
 
		if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		}
	}
} 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 oneIndex = 0;
 
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		}
 
		if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		int oneIndex = 0;
 
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		}
 
		if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		int oneIndex = 0;
 
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		}
 
		if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		}
	} 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 oneIndex = 0; oneIndex 0 for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				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') {
				oneIndex = i;
				break;
			}
		} {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		} if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			} S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
				oneIndex = i;
				break;
			} oneIndex = i oneIndex i break; if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		} K - 1 < oneIndex K - 1 K 1 oneIndex {
			System.out.println("1");
		} System.out.println("1") System.out.println System.out System System.out "1" {
			System.out.println(S.charAt(oneIndex));
		} System.out.println(S.charAt(oneIndex)) System.out.println System.out System System.out S.charAt(oneIndex) S.charAt S oneIndex 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 oneIndex = 0;
 
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		}
 
		if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		int oneIndex = 0;
 
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		}
 
		if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		}
	}
} 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 oneIndex = 0;
 
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i) != '1') {
				oneIndex = i;
				break;
			}
		}
 
		if (K - 1 < oneIndex) {
			System.out.println("1");
		} else {
			System.out.println(S.charAt(oneIndex));
		}
	}
}