#include <math.h>
#include <stdio.h>
long long convert(long long int b,long long int n);
int main() {
    long long int n,b,count=0;
    long long int num;
    scanf("%lld %lld", &n,&b);
    num=convert(n,b);
    while(num != 0)
    {
        num /= 10;
        ++count;
    }
    printf("%d", count);
    return 0;
}

long long convert(long long int n,long long int b) {
    long long pro = 0;
    long long int rem, i = 1;
    while (n != 0) {
        rem = n % b;
        n /= b;
        pro += rem * i;
        i *= 10;
    }
    return pro;
}
