import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		long k = sc.nextLong();
		int max = arr.length;
	    char first = '1';
	    for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    }
	    if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    }
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		long k = sc.nextLong();
		int max = arr.length;
	    char first = '1';
	    for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    }
	    if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    }
	}
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		long k = sc.nextLong();
		int max = arr.length;
	    char first = '1';
	    for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    }
	    if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    }
	} main {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		long k = sc.nextLong();
		int max = arr.length;
	    char first = '1';
	    for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    }
	    if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    }
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] arr = sc.next().toCharArray(); arr sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc int max = arr.length; max arr.length arr arr.length char first = '1'; first '1' for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    } {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    } if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        } arr[i] != '1' arr[i] arr i '1' {
	            max = i;
	            first = arr[i];
	            break;
	        } max = i max i first = arr[i] first arr[i] arr i break; if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    } max >= k max k {
	        System.out.println(1);
	    } System.out.println(1) System.out.println System.out System System.out 1 {
	        System.out.println(first);
	    } System.out.println(first) System.out.println System.out System System.out first String[] args args public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		long k = sc.nextLong();
		int max = arr.length;
	    char first = '1';
	    for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    }
	    if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    }
	}
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		long k = sc.nextLong();
		int max = arr.length;
	    char first = '1';
	    for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    }
	    if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    }
	}
} Main
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		long k = sc.nextLong();
		int max = arr.length;
	    char first = '1';
	    for (int i = 0; i < arr.length; i++) {
	        if (arr[i] != '1') {
	            max = i;
	            first = arr[i];
	            break;
	        }
	    }
	    if (max >= k) {
	        System.out.println(1);
	    } else {
	        System.out.println(first);
	    }
	}
}
