import 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 i = 0;
    	for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	}
    	if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	}
    }
} import java.util.*; util.* java public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	String S = sc.next();
    	long K = sc.nextLong();
    	int i = 0;
    	for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	}
    	if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	}
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	String S = sc.next();
    	long K = sc.nextLong();
    	int i = 0;
    	for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	}
    	if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	}
    } main {
    	Scanner sc = new Scanner(System.in);
    	String S = sc.next();
    	long K = sc.nextLong();
    	int i = 0;
    	for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	}
    	if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	}
    } 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 i = 0; i 0 for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	} ; i < S.length() i S.length() S.length S i++ i++ i {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	} {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	} if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		} S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
    			continue;
    		} continue; {
    			break;
    		} break; if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	} K <= i K i {
    		System.out.println(1);
    	} System.out.println(1) System.out.println System.out System System.out 1 {
    		System.out.println(S.charAt(i));
    	} System.out.println(S.charAt(i)) System.out.println System.out System System.out S.charAt(i) S.charAt S i 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 i = 0;
    	for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	}
    	if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	}
    }
} public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	String S = sc.next();
    	long K = sc.nextLong();
    	int i = 0;
    	for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	}
    	if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	}
    }
} Main
import 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 i = 0;
    	for (; i < S.length(); i++) {
    		if (S.charAt(i) == '1') {
    			continue;
    		} else {
    			break;
    		}
    	}
    	if (K <= i) {
    		System.out.println(1);
    	} else {
    		System.out.println(S.charAt(i));
    	}
    }
}