import java.util.*;

public class Main{

	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
        String sn = Integer.toString(sc.nextInt(),sc.nextInt());
      
        char[] ans = sn.toCharArray();
        System.out.println(ans.length);
       
	}
} import java.util.*; util.* java public class Main{

	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
        String sn = Integer.toString(sc.nextInt(),sc.nextInt());
      
        char[] ans = sn.toCharArray();
        System.out.println(ans.length);
       
	}
} Main public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
        String sn = Integer.toString(sc.nextInt(),sc.nextInt());
      
        char[] ans = sn.toCharArray();
        System.out.println(ans.length);
       
	} main {

		Scanner sc = new Scanner(System.in);
        String sn = Integer.toString(sc.nextInt(),sc.nextInt());
      
        char[] ans = sn.toCharArray();
        System.out.println(ans.length);
       
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String sn = Integer.toString(sc.nextInt(),sc.nextInt()); sn Integer.toString(sc.nextInt(),sc.nextInt()) Integer.toString Integer sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc char[] ans = sn.toCharArray(); ans sn.toCharArray() sn.toCharArray sn System.out.println(ans.length) System.out.println System.out System System.out ans.length ans ans.length String[] args args public class Main{

	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
        String sn = Integer.toString(sc.nextInt(),sc.nextInt());
      
        char[] ans = sn.toCharArray();
        System.out.println(ans.length);
       
	}
} public class Main{

	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
        String sn = Integer.toString(sc.nextInt(),sc.nextInt());
      
        char[] ans = sn.toCharArray();
        System.out.println(ans.length);
       
	}
} Main
import java.util.*;

public class Main{

	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
        String sn = Integer.toString(sc.nextInt(),sc.nextInt());
      
        char[] ans = sn.toCharArray();
        System.out.println(ans.length);
       
	}
}
