import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String ans = "";
		while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		}
		ans = n + ans;
		System.out.println(ans.length());

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String ans = "";
		while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		}
		ans = n + ans;
		System.out.println(ans.length());

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String ans = "";
		while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		}
		ans = n + ans;
		System.out.println(ans.length());

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String ans = "";
		while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		}
		ans = n + ans;
		System.out.println(ans.length());

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc String ans = ""; ans "" while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		} n >= k n k {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		} int mod = n % k; mod n % k n k ans = mod + ans ans mod + ans mod ans n = n/k n n/k n k ans = n + ans ans n + ans n ans System.out.println(ans.length()) System.out.println System.out System System.out ans.length() ans.length ans sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String ans = "";
		while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		}
		ans = n + ans;
		System.out.println(ans.length());

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String ans = "";
		while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		}
		ans = n + ans;
		System.out.println(ans.length());

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String ans = "";
		while(n >= k) {
			int mod = n % k;
			ans = mod + ans;
			n = n/k;
		}
		ans = n + ans;
		System.out.println(ans.length());

		sc.close();
	}
}