import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		String S = sc.next();
		long K = sc.nextLong();
		sc.close();
		
		for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		}
		out.println("1");

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		String S = sc.next();
		long K = sc.nextLong();
		sc.close();
		
		for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		}
		out.println("1");

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		String S = sc.next();
		long K = sc.nextLong();
		sc.close();
		
		for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		}
		out.println("1");

	} _main {
		Scanner sc = new Scanner(in);

		String S = sc.next();
		long K = sc.nextLong();
		sc.close();
		
		for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		}
		out.println("1");

	} Scanner sc = new Scanner(in); sc new Scanner(in) String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc sc.close() sc.close sc for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		} int i=0; int i=0; i 0 i<Math.min(S.length(),K) i Math.min(S.length(),K) Math.min Math S.length() S.length S K i++ i++ i {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		} {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		} if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			} S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
				out.println(S.charAt(i));
				return;
			} out.println(S.charAt(i)) out.println out S.charAt(i) S.charAt S i return; out.println("1") out.println out "1" String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		String S = sc.next();
		long K = sc.nextLong();
		sc.close();
		
		for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		}
		out.println("1");

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		String S = sc.next();
		long K = sc.nextLong();
		sc.close();
		
		for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		}
		out.println("1");

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		String S = sc.next();
		long K = sc.nextLong();
		sc.close();
		
		for(int i=0;i<Math.min(S.length(),K);i++) {
			if(S.charAt(i) != '1') {
				out.println(S.charAt(i));
				return;
			}
		}
		out.println("1");

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

}
