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();

		for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		}

		System.out.println(1);
	}
} 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();

		for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		}

		System.out.println(1);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		long K = sc.nextLong();

		for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		}

		System.out.println(1);
	} main {
		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		long K = sc.nextLong();

		for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				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 = sc.nextLong(); K sc.nextLong() sc.nextLong sc for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		} {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		} if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			} S.charAt(i) - '0' != 1 S.charAt(i) - '0' S.charAt(i) S.charAt S i '0' 1 {
				System.out.println(S.charAt(i) - '0');
				return;
			} System.out.println(S.charAt(i) - '0') System.out.println System.out System System.out S.charAt(i) - '0' S.charAt(i) S.charAt S i '0' 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 = sc.nextLong();

		for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				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 = sc.nextLong();

		for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		}

		System.out.println(1);
	}
} 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();

		for (int i = 0; i < K; i++) {
			if (S.charAt(i) - '0' != 1) {
				System.out.println(S.charAt(i) - '0');
				return;
			}
		}

		System.out.println(1);
	}
}