"use strict"
function main(arg) {
    var data = arg.trim().split("\n")[0].split(" ").map(Number)
    var N = data[0]
    var K = data[1]
    console.log(N.toString(K).split("").length)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));