   program abc156b
      implicit none
      integer(8)::N
      integer::K,i

      read *,N,K
      do i=1,30
         if (N/(K**i)<1) then
            print *,i
            stop
         end if
      end do

   end program abc156b