local s = io.read();
local k = tonumber(io.read());
local first = string.sub(s,1,1);

if k == 1 or string.len(s) == 1 then
    print(first);
else
    local count = 0;
    while first == "1" do
        count = count + 1;
        s = string.sub(s,2);
        first = string.sub(s,1,1);
    end

    if k <= count then
        print(1);
    else
    else
        first = string.sub(s,1,1);
        local tonext = math.log(tonumber(first)) * 5 * math.pow(10, 15);
        tonext = tonext // 1;
        if k <= tonext then
            print(first);
        else
            print(string.sub(s,2,2));
        end
    end
end