
if __name__ == '__main__':

	n,k = map(int,input().split())

	cnt = 1
	while True:
		if n % k == 0:
			n = n // k
		else:
			n = n - n % k
			n = n // k
		if n // k < k:
			if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			break
		cnt += 1
			
	print(cnt) if __name__ == '__main__':

	n,k = map(int,input().split())

	cnt = 1
	while True:
		if n % k == 0:
			n = n // k
		else:
			n = n - n % k
			n = n // k
		if n // k < k:
			if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			break
		cnt += 1
			
	print(cnt) __name__ == '__main__' __name__ '__main__' n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k cnt = 1 cnt 1 while True:
		if n % k == 0:
			n = n // k
		else:
			n = n - n % k
			n = n // k
		if n // k < k:
			if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			break
		cnt += 1
			
	 True if n % k == 0:
			n = n // k
		else:
			n = n - n % k
			n = n // k
		 n % k == 0 n % k n k 0 n = n // k n n // k n k n = n - n % k n n - n % k n n % k n k n = n // k n n // k n k if n // k < k:
			if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			break
		 n // k < k n // k n k k if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			 n // k == 0 n // k n k 0 if n % k == 0:
					pass
				else:
					cnt += 1
			 n % k == 0 n % k n k 0 cnt += 1 cnt 1 cnt += 2 cnt 2 break cnt += 1 cnt 1 print(cnt) print cnt cnt += 1 1 cnt n,k = map(int,input().split()) map(int,input().split()) n cnt = 1 1 cnt n = n - n % k n - n % k n n = n // k n // k n n = n // k n // k n cnt += 1 1 cnt k = map(int,input().split()) map(int,input().split()) k cnt += 2 2 cnt

if __name__ == '__main__':

	n,k = map(int,input().split())

	cnt = 1
	while True:
		if n % k == 0:
			n = n // k
		else:
			n = n - n % k
			n = n // k
		if n // k < k:
			if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			break
		cnt += 1
			
	print(cnt)
