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();
        String[] sArray = s.split("");
        String firstOther = null;
        for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        }
        if (firstOther == null) {
            System.out.println(1);
            return;
        }
        System.out.println(firstOther);
    }
} 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();
        String[] sArray = s.split("");
        String firstOther = null;
        for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        }
        if (firstOther == null) {
            System.out.println(1);
            return;
        }
        System.out.println(firstOther);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        String[] sArray = s.split("");
        String firstOther = null;
        for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        }
        if (firstOther == null) {
            System.out.println(1);
            return;
        }
        System.out.println(firstOther);
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        String[] sArray = s.split("");
        String firstOther = null;
        for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        }
        if (firstOther == null) {
            System.out.println(1);
            return;
        }
        System.out.println(firstOther);
    } 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 String[] sArray = s.split(""); sArray s.split("") s.split s "" String firstOther = null; firstOther null for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        } {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        } if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            } !sArray[i].equals("1") sArray[i].equals("1") sArray[i].equals sArray[i] sArray i "1" {
                firstOther = sArray[i];
                break;
            } firstOther = sArray[i] firstOther sArray[i] sArray i break; if (firstOther == null) {
            System.out.println(1);
            return;
        } firstOther == null firstOther null {
            System.out.println(1);
            return;
        } System.out.println(1) System.out.println System.out System System.out 1 return; System.out.println(firstOther) System.out.println System.out System System.out firstOther 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();
        String[] sArray = s.split("");
        String firstOther = null;
        for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        }
        if (firstOther == null) {
            System.out.println(1);
            return;
        }
        System.out.println(firstOther);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        String[] sArray = s.split("");
        String firstOther = null;
        for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        }
        if (firstOther == null) {
            System.out.println(1);
            return;
        }
        System.out.println(firstOther);
    }
} 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();
        String[] sArray = s.split("");
        String firstOther = null;
        for (int i = 0; i < k; i++) {
            if (!sArray[i].equals("1")) {
                firstOther = sArray[i];
                break;
            }
        }
        if (firstOther == null) {
            System.out.println(1);
            return;
        }
        System.out.println(firstOther);
    }
}