program main 
 implicit  none
 integer :: n,k,i
 read *, n,k
  do i=0,100
   if (n>k**i.and.n<k**(i+1)) then
    write(*,'(i0)') i
   else if (n==k**i) then
    write(*,'(i0)') i
   end if
  end do 
 stop
end program main