    program main
     implicit none
     integer N, K
     integer Nk
     integer keta
     integer i
     
     read *,N, K
     
     keta=0
     Nk=N
     do i=1,1000000000
      Nk=Nk/K
      keta =keta+1
      if (Nk<K) then
       if ( i /= 1 ) keta=keta+1
       print '(i0)', keta
       exit
      end if
     end do
     
    endprogram main