#!/usr/bin/env python3 from math import log n = int(input()) p = int(input()) lg = int(log(n, p)) print(lg)