import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		long K = scanner.nextLong();

		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		}
		System.out.println(1);
		scanner.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		long K = scanner.nextLong();

		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		}
		System.out.println(1);
		scanner.close();
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		long K = scanner.nextLong();

		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		}
		System.out.println(1);
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		long K = scanner.nextLong();

		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		}
		System.out.println(1);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.nextLine(); S scanner.nextLine() scanner.nextLine scanner long K = scanner.nextLong(); K scanner.nextLong() scanner.nextLong scanner StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		} {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		} if (S.charAt(i) == '1') {
				continue;
			} S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
				continue;
			} continue; System.out.println(S.charAt(i)) System.out.println System.out System System.out S.charAt(i) S.charAt S i return; System.out.println(1) System.out.println System.out System System.out 1 scanner.close() scanner.close scanner String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		long K = scanner.nextLong();

		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		}
		System.out.println(1);
		scanner.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		long K = scanner.nextLong();

		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		}
		System.out.println(1);
		scanner.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.nextLine();
		long K = scanner.nextLong();

		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < K; i++) {
			if (S.charAt(i) == '1') {
				continue;
			}
			System.out.println(S.charAt(i));
			return;
		}
		System.out.println(1);
		scanner.close();
	}
}