import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} Main public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    } main {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    } try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String s = br.readLine(); s br.readLine() br.readLine br long k = Long.parseLong(br.readLine()); k Long.parseLong(br.readLine()) Long.parseLong Long br.readLine() br.readLine br int ans = 1; ans 1 for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            } {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            } int tempNum = Integer.parseInt(s.substring(i, i + 1)); tempNum Integer.parseInt(s.substring(i, i + 1)) Integer.parseInt Integer s.substring(i, i + 1) s.substring s i i + 1 i 1 if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                } tempNum != 1 tempNum 1 {
                    ans = tempNum;
                    break;
                } ans = tempNum ans tempNum break; {
                    if (k == i + 1) {
                        break;
                    }
                } if (k == i + 1) {
                        break;
                    } k == i + 1 k i + 1 i 1 {
                        break;
                    } break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String s = br.readLine();
            long k = Long.parseLong(br.readLine());
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                int tempNum = Integer.parseInt(s.substring(i, i + 1));
                if (tempNum != 1) {
                    ans = tempNum;
                    break;
                } else {
                    if (k == i + 1) {
                        break;
                    }
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
