import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		final long K = sc.nextLong();
		char[] chars = s.toCharArray();

        for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        }
        System.out.println("1");
	}
} 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();
		final long K = sc.nextLong();
		char[] chars = s.toCharArray();

        for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        }
        System.out.println("1");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		final long K = sc.nextLong();
		char[] chars = s.toCharArray();

        for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        }
        System.out.println("1");
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		final long K = sc.nextLong();
		char[] chars = s.toCharArray();

        for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        }
        System.out.println("1");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc final long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc char[] chars = s.toCharArray(); chars s.toCharArray() s.toCharArray s for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        } int i = 0; int i = 0; i 0 i < K && i < chars.length i < K i K i < chars.length i chars.length chars chars.length i++ i++ i {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        } {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        } if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			} chars[i] != '1' chars[i] chars i '1' {
            	System.out.println(chars[i]);
            	return;
			} System.out.println(chars[i]) System.out.println System.out System System.out chars[i] chars i return; System.out.println("1") System.out.println System.out System System.out "1" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		final long K = sc.nextLong();
		char[] chars = s.toCharArray();

        for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        }
        System.out.println("1");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		final long K = sc.nextLong();
		char[] chars = s.toCharArray();

        for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        }
        System.out.println("1");
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		final long K = sc.nextLong();
		char[] chars = s.toCharArray();

        for(int i = 0; i < K && i < chars.length; i++) {
            if (chars[i] != '1') {
            	System.out.println(chars[i]);
            	return;
			}
        }
        System.out.println("1");
	}
}