import java.math.BigDecimal;
import java.math.MathContext;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long k = scanner.nextLong();
        for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        }
    }

}

 import java.math.BigDecimal; BigDecimal java.math import java.math.MathContext; MathContext java.math import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long k = scanner.nextLong();
        for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        }
    }

} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long k = scanner.nextLong();
        for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long k = scanner.nextLong();
        for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner long k = scanner.nextLong(); k scanner.nextLong() scanner.nextLong scanner for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s ++i ++i i {
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        } {
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        } int a = Integer.valueOf(s.substring(i,i + 1)); a Integer.valueOf(s.substring(i,i + 1)) Integer.valueOf Integer s.substring(i,i + 1) s.substring s i i + 1 i 1 if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            } a != 1 a 1 {
                System.out.println(a);
                return;
            } System.out.println(a) System.out.println System.out System System.out a return; if(k - 1 == i){
                System.out.println(a);
                return;
            } k - 1 == i k - 1 k 1 i {
                System.out.println(a);
                return;
            } System.out.println(a) System.out.println System.out System System.out a return; String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long k = scanner.nextLong();
        for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        }
    }

} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long k = scanner.nextLong();
        for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        }
    }

} Main
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        long k = scanner.nextLong();
        for (int i = 0;i < s.length();++i){
            int a = Integer.valueOf(s.substring(i,i + 1));
            if(a != 1){
                System.out.println(a);
                return;
            }
            else if(k - 1 == i){
                System.out.println(a);
                return;
            }
        }
    }

}


