import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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();
		String[] SSplit = S.split("");
		int countOne = 0;
		for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		}
		if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		}
	}
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set 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();
		String[] SSplit = S.split("");
		int countOne = 0;
		for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		}
		if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		}
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		String[] SSplit = S.split("");
		int countOne = 0;
		for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		}
		if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		String[] SSplit = S.split("");
		int countOne = 0;
		for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		}
		if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		}
	} 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 String[] SSplit = S.split(""); SSplit S.split("") S.split S "" int countOne = 0; countOne 0 for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		} int i = 0; int i = 0; i 0 i < SSplit.length i SSplit.length SSplit SSplit.length i++ i++ i {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		} {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		} if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			} "1".equals(SSplit[i]) "1".equals "1" SSplit[i] SSplit i {
				countOne++;
			} countOne++ countOne {
				break;
			} break; if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		} K <= countOne K countOne {
			System.out.print(1);
		} System.out.print(1) System.out.print System.out System System.out 1 {
			System.out.print(SSplit[countOne]);
		} System.out.print(SSplit[countOne]) System.out.print System.out System System.out SSplit[countOne] SSplit countOne 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();
		String[] SSplit = S.split("");
		int countOne = 0;
		for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		}
		if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		}
	}
} 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();
		String[] SSplit = S.split("");
		int countOne = 0;
		for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		}
		if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		}
	}
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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();
		String[] SSplit = S.split("");
		int countOne = 0;
		for (int i = 0; i < SSplit.length; i++) {
			if ("1".equals(SSplit[i])) {
				countOne++;
			} else {
				break;
			}
		}
		if (K <= countOne) {
			System.out.print(1);
		} else {
			System.out.print(SSplit[countOne]);
		}
	}
}
