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();
    int idx = -1;
    for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    }
    if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    }
  }
} 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();
    int idx = -1;
    for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    }
    if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int idx = -1;
    for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    }
    if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    }
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int idx = -1;
    for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    }
    if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    }
  } 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 idx = -1; idx -1 1 for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        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') {
        idx = i;
        break;
      }
    } {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    } if (S.charAt(i) != '1') {
        idx = i;
        break;
      } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
        idx = i;
        break;
      } idx = i idx i break; if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    } idx < 0 idx 0 {
      System.out.println(1);
    } System.out.println(1) System.out.println System.out System System.out 1 {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    } if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      } K < idx + 1 K idx + 1 idx 1 {
        System.out.println(1);
      } System.out.println(1) System.out.println System.out System System.out 1 {
        System.out.println(S.charAt(idx));
      } System.out.println(S.charAt(idx)) System.out.println System.out System System.out S.charAt(idx) S.charAt S idx 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 idx = -1;
    for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    }
    if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int idx = -1;
    for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    }
    if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    }
  }
} 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();
    int idx = -1;
    for (int i = 0; i < S.length(); i++) {
      if (S.charAt(i) != '1') {
        idx = i;
        break;
      }
    }
    if (idx < 0) {
      System.out.println(1);
    } else {
      if (K < idx + 1) {
        System.out.println(1);
      } else {
        System.out.println(S.charAt(idx));
      }
    }
  }
}