import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s=sc.nextLine();
		long k=sc.nextLong();
		char c[]=s.toCharArray();
		int one=0;
		char ans='a';
		for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		}
		if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(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.nextLine();
		long k=sc.nextLong();
		char c[]=s.toCharArray();
		int one=0;
		char ans='a';
		for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		}
		if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(ans);
		}

	}} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s=sc.nextLine();
		long k=sc.nextLong();
		char c[]=s.toCharArray();
		int one=0;
		char ans='a';
		for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		}
		if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(ans);
		}

	} main {

		Scanner sc = new Scanner(System.in);

		String s=sc.nextLine();
		long k=sc.nextLong();
		char c[]=s.toCharArray();
		int one=0;
		char ans='a';
		for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		}
		if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(ans);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.nextLine(); s sc.nextLine() sc.nextLine sc long k=sc.nextLong(); k sc.nextLong() sc.nextLong sc char c[]=s.toCharArray(); c s.toCharArray() s.toCharArray s int one=0; one 0 char ans='a'; ans 'a' for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		} {
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		} if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;} c[i]=='1' c[i] c i '1' {
				one++;
			} one++ one {
				ans=c[i];
				break;} ans=c[i] ans c[i] c i break; if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(ans);
		} one>=k one k {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			System.out.println(ans);
		} System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s=sc.nextLine();
		long k=sc.nextLong();
		char c[]=s.toCharArray();
		int one=0;
		char ans='a';
		for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		}
		if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(ans);
		}

	}} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s=sc.nextLine();
		long k=sc.nextLong();
		char c[]=s.toCharArray();
		int one=0;
		char ans='a';
		for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		}
		if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(ans);
		}

	}} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s=sc.nextLine();
		long k=sc.nextLong();
		char c[]=s.toCharArray();
		int one=0;
		char ans='a';
		for(int i=0;i<s.length();i++){
			if(c[i]=='1'){
				one++;
			}else{
				ans=c[i];
				break;}
		}
		if(one>=k){
			System.out.println(1);
		}else{
			System.out.println(ans);
		}

	}}