const base_n = (n,d)=> (n/d >= 1) ? base_n( Math.floor(n/d),d ) + (n%d).toString() : ( (n%d) || '1').toString();function Main(input) {
  input = input.trim().split(' ').map(data=>parseInt(data));
  console.log(base_n(input[0],input[1]).length)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));