import java.util.Scanner;

public class Main {

    public static String converter(String number, int base, int dest){
        return Integer.toString(Integer.parseInt(number, base), dest);
    }

    private static int converter(String number, int dest){
        return converter(number, 10, dest).length();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int dest = scanner.nextInt();
        System.out.println(converter(s, dest));
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static String converter(String number, int base, int dest){
        return Integer.toString(Integer.parseInt(number, base), dest);
    }

    private static int converter(String number, int dest){
        return converter(number, 10, dest).length();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int dest = scanner.nextInt();
        System.out.println(converter(s, dest));
    }
} Main public static String converter(String number, int base, int dest){
        return Integer.toString(Integer.parseInt(number, base), dest);
    } converter {
        return Integer.toString(Integer.parseInt(number, base), dest);
    } return Integer.toString(Integer.parseInt(number, base), dest); Integer.toString(Integer.parseInt(number, base), dest) Integer.toString Integer Integer.parseInt(number, base) Integer.parseInt Integer number base dest String number number int base base int dest dest private static int converter(String number, int dest){
        return converter(number, 10, dest).length();
    } converter {
        return converter(number, 10, dest).length();
    } return converter(number, 10, dest).length(); converter(number, 10, dest).length() converter(number, 10, dest).length converter(number, 10, dest) converter number 10 dest String number number int dest dest public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int dest = scanner.nextInt();
        System.out.println(converter(s, dest));
    } main {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int dest = scanner.nextInt();
        System.out.println(converter(s, dest));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner int dest = scanner.nextInt(); dest scanner.nextInt() scanner.nextInt scanner System.out.println(converter(s, dest)) System.out.println System.out System System.out converter(s, dest) converter s dest String[] args args public class Main {

    public static String converter(String number, int base, int dest){
        return Integer.toString(Integer.parseInt(number, base), dest);
    }

    private static int converter(String number, int dest){
        return converter(number, 10, dest).length();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int dest = scanner.nextInt();
        System.out.println(converter(s, dest));
    }
} public class Main {

    public static String converter(String number, int base, int dest){
        return Integer.toString(Integer.parseInt(number, base), dest);
    }

    private static int converter(String number, int dest){
        return converter(number, 10, dest).length();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int dest = scanner.nextInt();
        System.out.println(converter(s, dest));
    }
} Main
import java.util.Scanner;

public class Main {

    public static String converter(String number, int base, int dest){
        return Integer.toString(Integer.parseInt(number, base), dest);
    }

    private static int converter(String number, int dest){
        return converter(number, 10, dest).length();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int dest = scanner.nextInt();
        System.out.println(converter(s, dest));
    }
}