

import java.util.Scanner;

// 十分大きな回数を重ねると何かが収束する
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();

        int inchiNum = 0;
        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        }
        if(inchiNum >= k) 
        {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(inchiNum));
        }
    }
} 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.next();
        long k = sc.nextLong();

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

        int inchiNum = 0;
        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        }
        if(inchiNum >= k) 
        {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(inchiNum));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();

        int inchiNum = 0;
        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        }
        if(inchiNum >= k) 
        {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(inchiNum));
        }
    } 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 int inchiNum = 0; inchiNum 0 for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        } {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        } if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                inchiNum++;
            } inchiNum++ inchiNum {
                break;
            } break; if(inchiNum >= k) 
        {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(inchiNum));
        } inchiNum >= k inchiNum k {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            System.out.println(s.charAt(inchiNum));
        } System.out.println(s.charAt(inchiNum)) System.out.println System.out System System.out s.charAt(inchiNum) s.charAt s inchiNum 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();

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

        int inchiNum = 0;
        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        }
        if(inchiNum >= k) 
        {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(inchiNum));
        }
    }
} Main


import java.util.Scanner;

// 十分大きな回数を重ねると何かが収束する
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();

        int inchiNum = 0;
        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1') {
                inchiNum++;
            } else {
                break;
            }
        }
        if(inchiNum >= k) 
        {
            System.out.println(1);
        } else {
            System.out.println(s.charAt(inchiNum));
        }
    }
}
