import java.util.*;

public class Main{
	public static void main(String[]$){
		Scanner s=new Scanner(System.in);
		System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length());
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[]$){
		Scanner s=new Scanner(System.in);
		System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length());
	}
} Main public static void main(String[]$){
		Scanner s=new Scanner(System.in);
		System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length());
	} main {
		Scanner s=new Scanner(System.in);
		System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length());
	} Scanner s=new Scanner(System.in); s new Scanner(System.in) System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length()) System.out.println System.out System System.out Integer.toString(s.nextInt(),s.nextInt()).length() Integer.toString(s.nextInt(),s.nextInt()).length Integer.toString(s.nextInt(),s.nextInt()) Integer.toString Integer s.nextInt() s.nextInt s s.nextInt() s.nextInt s String[]$ $ public class Main{
	public static void main(String[]$){
		Scanner s=new Scanner(System.in);
		System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length());
	}
} public class Main{
	public static void main(String[]$){
		Scanner s=new Scanner(System.in);
		System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length());
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[]$){
		Scanner s=new Scanner(System.in);
		System.out.println(Integer.toString(s.nextInt(),s.nextInt()).length());
	}
}
