import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		long K = in.nextLong();
		boolean flag = true;
		int i = 0;
		int k = 0;
		while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		}
		if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		}

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		long K = in.nextLong();
		boolean flag = true;
		int i = 0;
		int k = 0;
		while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		}
		if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		}

	}

} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		long K = in.nextLong();
		boolean flag = true;
		int i = 0;
		int k = 0;
		while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		}
		if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		}

	} main {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		long K = in.nextLong();
		boolean flag = true;
		int i = 0;
		int k = 0;
		while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		}
		if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		}

	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String S = in.next(); S in.next() in.next in long K = in.nextLong(); K in.nextLong() in.nextLong in boolean flag = true; flag true int i = 0; i 0 int k = 0; k 0 while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		} flag&&i<S.length() flag i<S.length() i S.length() S.length S {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		} if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			} S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
				i++;
			} i++ i {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			} flag = false flag false k = Integer.parseInt("" + S.charAt(i)) k Integer.parseInt("" + S.charAt(i)) Integer.parseInt Integer "" + S.charAt(i) "" S.charAt(i) S.charAt S i if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		} K < i + 1 K i + 1 i 1 {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			System.out.println(k);
		} System.out.println(k) System.out.println System.out System System.out k String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		long K = in.nextLong();
		boolean flag = true;
		int i = 0;
		int k = 0;
		while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		}
		if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		long K = in.nextLong();
		boolean flag = true;
		int i = 0;
		int k = 0;
		while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		}
		if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		long K = in.nextLong();
		boolean flag = true;
		int i = 0;
		int k = 0;
		while (flag&&i<S.length()) {
			if (S.charAt(i) == '1') {
				i++;
			} else {
				flag = false;
				k = Integer.parseInt("" + S.charAt(i));
			}
		}
		if (K < i + 1) {
			System.out.println(1);
		} else {
			System.out.println(k);
		}

	}

}