
import java.util.Scanner;

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

		String str = scan.next();
		long k = scan.nextLong();
		char result = 0;
		if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		}
		for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		}
		System.out.println(result);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String str = scan.next();
		long k = scan.nextLong();
		char result = 0;
		if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		}
		for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		}
		System.out.println(result);
	}

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

		String str = scan.next();
		long k = scan.nextLong();
		char result = 0;
		if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		}
		for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		}
		System.out.println(result);
	} main {
		Scanner scan = new Scanner(System.in);

		String str = scan.next();
		long k = scan.nextLong();
		char result = 0;
		if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		}
		for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		}
		System.out.println(result);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.next(); str scan.next() scan.next scan long k = scan.nextLong(); k scan.nextLong() scan.nextLong scan char result = 0; result 0 if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		} k >= str.length() k str.length() str.length str {
		} {
			str = str.substring(0, (int) k );
		} str = str.substring(0, (int) k ) str str.substring(0, (int) k ) str.substring str 0 (int) k for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		} int i = 0; int i = 0; i 0 i <= str.length() - 1 i str.length() - 1 str.length() str.length str 1 i++ i++ i {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		} {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		} result = str.charAt(i) result str.charAt(i) str.charAt str i if (result != '1') {
				break;
			} result != '1' result '1' {
				break;
			} break; System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String str = scan.next();
		long k = scan.nextLong();
		char result = 0;
		if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		}
		for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		}
		System.out.println(result);
	}

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

		String str = scan.next();
		long k = scan.nextLong();
		char result = 0;
		if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		}
		for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		}
		System.out.println(result);
	}

} Main

import java.util.Scanner;

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

		String str = scan.next();
		long k = scan.nextLong();
		char result = 0;
		if (k >= str.length()) {
		} else {
			str = str.substring(0, (int) k );
		}
		for (int i = 0; i <= str.length() - 1; i++) {
			result = str.charAt(i);
			if (result != '1') {
				break;
			}
		}
		System.out.println(result);
	}

}
