
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 ans = 0;
		for(int i = 0; i < k; i++) {
			if(s.charAt(i) == '1') {
				if(i + 1 == k) {
					ans = i;
					break;
				}
			} else {
				ans = i;
				break;
			}
		}
		System.out.println(s.charAt(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();
		long k = sc.nextLong();
		int ans = 0;
		for(int i = 0; i < k; i++) {
			if(s.charAt(i) == '1') {
				if(i + 1 == k) {
					ans = i;
					break;
				}
			} else {
				ans = i;
				break;
			}
		}
		System.out.println(s.charAt(ans));
	}

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

} public class Main {

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

}
