function Main(input) {
  var tmp = input.trim().split(' ')
  var N = parseInt(tmp[0])
  var K = parseInt(tmp[1])

  var str = ''

  var tmp = N
  while (tmp != 0) {
    str = (tmp % K).toString() + str
    tmp = Math.floor(tmp / K)
  }

  var result = str.length

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))