import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		String result = "";
		while (N > 0) {
			result = N % K + result;
			N /= K;
		}

		out.println(result.length());
		out.flush();
	}
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		String result = "";
		while (N > 0) {
			result = N % K + result;
			N /= K;
		}

		out.println(result.length());
		out.flush();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		String result = "";
		while (N > 0) {
			result = N % K + result;
			N /= K;
		}

		out.println(result.length());
		out.flush();
	} main {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		String result = "";
		while (N > 0) {
			result = N % K + result;
			N /= K;
		}

		out.println(result.length());
		out.flush();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String result = ""; result "" while (N > 0) {
			result = N % K + result;
			N /= K;
		} N > 0 N 0 {
			result = N % K + result;
			N /= K;
		} result = N % K + result result N % K + result N % K N K result N /= K N K out.println(result.length()) out.println out result.length() result.length result out.flush() out.flush out String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		String result = "";
		while (N > 0) {
			result = N % K + result;
			N /= K;
		}

		out.println(result.length());
		out.flush();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		String result = "";
		while (N > 0) {
			result = N % K + result;
			N /= K;
		}

		out.println(result.length());
		out.flush();
	}
} Main
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		String result = "";
		while (N > 0) {
			result = N % K + result;
			N /= K;
		}

		out.println(result.length());
		out.flush();
	}
}