'use strict'

function main(input) {
  input = input.split('\n');
  const s = input[0].split('');
  const k = Number(input[1]);

  let ans = '1';

  for (var i = 0; i < input.length && i < k; i++) {
    if (s[i] !== '1') {
      ans = s[i];
      break;
    }
  }

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
