import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
 
public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int K = scanner.nextInt();
    List<Integer> list = new ArrayList<>();
    if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    }
    System.out.println(list.size());
  }
} import java.util.Scanner; Scanner java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int K = scanner.nextInt();
    List<Integer> list = new ArrayList<>();
    if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    }
    System.out.println(list.size());
  }
} Main public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int K = scanner.nextInt();
    List<Integer> list = new ArrayList<>();
    if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    }
    System.out.println(list.size());
  } main {
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int K = scanner.nextInt();
    List<Integer> list = new ArrayList<>();
    if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    }
    System.out.println(list.size());
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int K = scanner.nextInt(); K scanner.nextInt() scanner.nextInt scanner List<Integer> list = new ArrayList<>(); list new ArrayList<>() if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    } N < K N K {
      list.add(N);
    } list.add(N) list.add list N {
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    } while(N >= K){
        list.add(N % K);
        N = N / K;
      } N >= K N K {
        list.add(N % K);
        N = N / K;
      } list.add(N % K) list.add list N % K N K N = N / K N N / K N K if(N != 0)list.add(N); N != 0 N 0 list.add(N) list.add list N System.out.println(list.size()) System.out.println System.out System System.out list.size() list.size list String[] args args public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int K = scanner.nextInt();
    List<Integer> list = new ArrayList<>();
    if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    }
    System.out.println(list.size());
  }
} public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int K = scanner.nextInt();
    List<Integer> list = new ArrayList<>();
    if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    }
    System.out.println(list.size());
  }
} Main
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
 
public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int K = scanner.nextInt();
    List<Integer> list = new ArrayList<>();
    if(N < K){
      list.add(N);
    }else{
      while(N >= K){
        list.add(N % K);
        N = N / K;
      }
      if(N != 0)list.add(N);
    }
    System.out.println(list.size());
  }
}