'use strict'
function main(input) {
  input = input.trim().split('\n')
  const S = input.shift().split('')
  const K = Number(input[0])
  let ans = ''
  for (let i = 0; i < S.length && i < K; i++) {
    ans = S[i]
    if (Number(ans) > 1) break
  }
  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
