import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        long n = Long.parseLong(sc.next());
        long k = Long.parseLong(sc.next());
        long b = n / k;
        List<Long> digits = new ArrayList<>();
        if (b > 0) digits.add(n % k);
        while (b >= k) {
            b /= k;
            digits.add(b % k);
        }
        out.println(digits.size() + 1);
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        long n = Long.parseLong(sc.next());
        long k = Long.parseLong(sc.next());
        long b = n / k;
        List<Long> digits = new ArrayList<>();
        if (b > 0) digits.add(n % k);
        while (b >= k) {
            b /= k;
            digits.add(b % k);
        }
        out.println(digits.size() + 1);
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        long n = Long.parseLong(sc.next());
        long k = Long.parseLong(sc.next());
        long b = n / k;
        List<Long> digits = new ArrayList<>();
        if (b > 0) digits.add(n % k);
        while (b >= k) {
            b /= k;
            digits.add(b % k);
        }
        out.println(digits.size() + 1);
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        long n = Long.parseLong(sc.next());
        long k = Long.parseLong(sc.next());
        long b = n / k;
        List<Long> digits = new ArrayList<>();
        if (b > 0) digits.add(n % k);
        while (b >= k) {
            b /= k;
            digits.add(b % k);
        }
        out.println(digits.size() + 1);
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) long n = Long.parseLong(sc.next()); n Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long k = Long.parseLong(sc.next()); k Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long b = n / k; b n / k n k List<Long> digits = new ArrayList<>(); digits new ArrayList<>() if (b > 0) digits.add(n % k); b > 0 b 0 digits.add(n % k) digits.add digits n % k n k while (b >= k) {
            b /= k;
            digits.add(b % k);
        } b >= k b k {
            b /= k;
            digits.add(b % k);
        } b /= k b k digits.add(b % k) digits.add digits b % k b k out.println(digits.size() + 1) out.println out digits.size() + 1 digits.size() digits.size digits 1 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);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        long n = Long.parseLong(sc.next());
        long k = Long.parseLong(sc.next());
        long b = n / k;
        List<Long> digits = new ArrayList<>();
        if (b > 0) digits.add(n % k);
        while (b >= k) {
            b /= k;
            digits.add(b % k);
        }
        out.println(digits.size() + 1);
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        long n = Long.parseLong(sc.next());
        long k = Long.parseLong(sc.next());
        long b = n / k;
        List<Long> digits = new ArrayList<>();
        if (b > 0) digits.add(n % k);
        while (b >= k) {
            b /= k;
            digits.add(b % k);
        }
        out.println(digits.size() + 1);
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        long n = Long.parseLong(sc.next());
        long k = Long.parseLong(sc.next());
        long b = n / k;
        List<Long> digits = new ArrayList<>();
        if (b > 0) digits.add(n % k);
        while (b >= k) {
            b /= k;
            digits.add(b % k);
        }
        out.println(digits.size() + 1);
        out.flush();
    }
}