import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();

		int idx = -1;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				idx = i;
			} else {
				break;
			}
		}
		if (idx == -1) {
			System.out.println(s.charAt(0));
		} else if (idx >= k - 1) {
			System.out.println("1");
		} else {
			System.out.println(s.charAt(idx + 1));
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();

		int idx = -1;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				idx = i;
			} else {
				break;
			}
		}
		if (idx == -1) {
			System.out.println(s.charAt(0));
		} else if (idx >= k - 1) {
			System.out.println("1");
		} else {
			System.out.println(s.charAt(idx + 1));
		}
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();

		int idx = -1;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				idx = i;
			} else {
				break;
			}
		}
		if (idx == -1) {
			System.out.println(s.charAt(0));
		} else if (idx >= k - 1) {
			System.out.println("1");
		} else {
			System.out.println(s.charAt(idx + 1));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();

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

		int idx = -1;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				idx = i;
			} else {
				break;
			}
		}
		if (idx == -1) {
			System.out.println(s.charAt(0));
		} else if (idx >= k - 1) {
			System.out.println("1");
		} else {
			System.out.println(s.charAt(idx + 1));
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();

		int idx = -1;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				idx = i;
			} else {
				break;
			}
		}
		if (idx == -1) {
			System.out.println(s.charAt(0));
		} else if (idx >= k - 1) {
			System.out.println("1");
		} else {
			System.out.println(s.charAt(idx + 1));
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long k = sc.nextLong();
		sc.close();

		int idx = -1;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '1') {
				idx = i;
			} else {
				break;
			}
		}
		if (idx == -1) {
			System.out.println(s.charAt(0));
		} else if (idx >= k - 1) {
			System.out.println("1");
		} else {
			System.out.println(s.charAt(idx + 1));
		}
	}
}
