import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int baseNum = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		int num01 = 1;
		int num02 = 2;

		while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		}
		if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		}
		sc.close();
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int baseNum = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		int num01 = 1;
		int num02 = 2;

		while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		}
		if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		}
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int baseNum = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		int num01 = 1;
		int num02 = 2;

		while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		}
		if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int baseNum = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		int num01 = 1;
		int num02 = 2;

		while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		}
		if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int baseNum = sc.nextInt(); baseNum sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() int num01 = 1; num01 1 int num02 = 2; num02 2 while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		} num > baseNum num baseNum {
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		} if (num <= baseNum) {
				break;
			} num <= baseNum num baseNum {
				break;
			} break; num = num/baseNum num num/baseNum num baseNum list.add(num%baseNum) list.add list num%baseNum num baseNum if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		} num == baseNum num baseNum {
			System.out.println((list.size()+num02));
		} System.out.println((list.size()+num02)) System.out.println System.out System System.out (list.size()+num02) list.size() list.size list num02 {
			System.out.println((list.size()+num01));
		} System.out.println((list.size()+num01)) System.out.println System.out System System.out (list.size()+num01) list.size() list.size list num01 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int baseNum = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		int num01 = 1;
		int num02 = 2;

		while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		}
		if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		}
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int baseNum = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		int num01 = 1;
		int num02 = 2;

		while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		}
		if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		}
		sc.close();
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int baseNum = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		int num01 = 1;
		int num02 = 2;

		while(num > baseNum){
			if (num <= baseNum) {
				break;
			}
			num = num/baseNum;
			list.add(num%baseNum);
		}
		if(num == baseNum){
			System.out.println((list.size()+num02));
		}else{
			System.out.println((list.size()+num01));
		}
		sc.close();
	}
}