import java.util.Scanner;

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

		String s = sc.next();
		int n = s.length();
		long k = Long.parseLong(sc.next());
		sc.close();

		int idx = -1;
		char ans = '1';

		for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		}

		if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		}
	}
} 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();
		int n = s.length();
		long k = Long.parseLong(sc.next());
		sc.close();

		int idx = -1;
		char ans = '1';

		for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		}

		if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		int n = s.length();
		long k = Long.parseLong(sc.next());
		sc.close();

		int idx = -1;
		char ans = '1';

		for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		}

		if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		}
	} main {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		int n = s.length();
		long k = Long.parseLong(sc.next());
		sc.close();

		int idx = -1;
		char ans = '1';

		for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		}

		if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int n = s.length(); n s.length() s.length s long k = Long.parseLong(sc.next()); k Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc sc.close() sc.close sc int idx = -1; idx -1 1 char ans = '1'; ans '1' for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		} {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		} if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			} s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			} idx = i + 1 idx i + 1 i 1 ans = s.charAt(i) ans s.charAt(i) s.charAt s i break; if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		} k < idx k idx {
			System.out.println(1);
			return;
		} System.out.println(1) System.out.println System.out System System.out 1 return; {
			System.out.println(ans);
		} System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		int n = s.length();
		long k = Long.parseLong(sc.next());
		sc.close();

		int idx = -1;
		char ans = '1';

		for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		}

		if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		int n = s.length();
		long k = Long.parseLong(sc.next());
		sc.close();

		int idx = -1;
		char ans = '1';

		for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		}

		if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		}
	}
} Main
import java.util.Scanner;

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

		String s = sc.next();
		int n = s.length();
		long k = Long.parseLong(sc.next());
		sc.close();

		int idx = -1;
		char ans = '1';

		for (int i = 0; i < n; i++) {
			if (s.charAt(i) != '1') {
				idx = i + 1;
				ans = s.charAt(i);
				break;
			}
		}

		if (k < idx) {
			System.out.println(1);
			return;
		} else {
			System.out.println(ans);
		}
	}
}