Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk.

Unfortunately, internet is not that fast in the city of Ekaterinozavodsk and the song takes a lot of time to download. But Lesha is quite impatient. The song's duration is T seconds. Lesha downloads the first S seconds of the song and plays it. When the playback reaches the point that has not yet been downloaded, Lesha immediately plays the song from the start (the loaded part of the song stays in his phone, and the download is continued from the same place), and it happens until the song is downloaded completely and Lesha listens to it to the end. For q seconds of real time the Internet allows you to download q - 1 seconds of the track.

Tell Lesha, for how many times he will start the song, including the very first start.


-----Input-----

The single line contains three integers T, S, q (2 ≤ q ≤ 10^4, 1 ≤ S < T ≤ 10^5).


-----Output-----

Print a single integer — the number of times the song will be restarted.


-----Examples-----
Input
5 2 2

Output
2

Input
5 4 7

Output
1

Input
6 2 3

Output
1



-----Note-----

In the first test, the song is played twice faster than it is downloaded, which means that during four first seconds Lesha reaches the moment that has not been downloaded, and starts the song again. After another two seconds, the song is downloaded completely, and thus, Lesha starts the song twice.

In the second test, the song is almost downloaded, and Lesha will start it only once.

In the third sample test the download finishes and Lesha finishes listening at the same moment. Note that song isn't restarted in this case.

Difficulty: interview

Starter code:

Solutions:
t, s, q = [int(i) for i in input().split()]
a = 1
l = 0
while t > s:
    l += q
    l = min(l, t)
    s += q - 1
    s = min(s, t)
    if l >= s and s != t:
        a += 1
        l = 0
print(a)


T, S, q = list(map(int, input().split()))
zap = 0
while S < T:
    S = S*q
    zap += 1
print(zap)


t, s, q = map(int, input().split())
x = s
ans = 1
while x < t:
    ans += 1
    x += (q - 1) * s
    s = x
print(ans - 1)

t,s,q=list(map(int,input().split(' ')))
c=1
while s<t:
    x=q*s-s
    s+=x
    c+=1
print(c-1)

T, S, q = map(int, input().split())
ans = 0
x = 0

while x < T:
    x = S * q
    S = x
    ans += 1

print(ans)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time
import math

(T, S, q) = (int(i) for i in input().split())
start = time.time()

ans = math.log(T/S, q)
if int(ans) - ans != 0:
    ans = int(ans) + 1
else:
    ans = int(ans)
print(ans)
finish = time.time()
#print(finish - start)




t, s, q = list(map(int, input().split()))
ans = 1

while True:
    x = s * q
    if x >= t:
        break

    ans += 1
    s = x

print(ans)


t, s, q = list(map(int, input().split()))
r = 1
while t > s * q:
    s *= q
    r += 1
print(r)
    


t, s, q = list(map(int, input().split(" ")))
ans = 0
while s < t:
    ans += 1
    s = s * q
    
print (ans)




T, S, q = [int(i) for i in input().split(' ')]

res = 1

loaded = S
while loaded*q < T:
  loaded = loaded*q
  res+=1
print(res)

t, s, q = [int(i) for i in input().split()]
c = (q - 1) / q
cnt = 1
time = s
while True:
    time = time / (1 - c)
    if t - time <= 0.0001:
        break
    cnt += 1
print(cnt)

info=list(map(int,input().split()))
t=info[0]
s=info[1]
q=info[2]
q=(q-1)/q
p=s
ans=0
while p<t:

    p=p/(1-q)
    if ((int(p)+1)-p)<.005:
        p=int(p)+1
    ans+=1
    
print(ans)    


t,s,q = [int(x) for x in input().split()]
a = 0
while s<t:
    s = s*q
    a = a+1
print(a)

T,S,q = map(int,input().split())
ans = 0
while S<T:
    ans+=1
    S*=q
print(ans)

n,m,r=list(map(int,input().split()));o=0
while(m<n):
        m*=r;o+=1
print(o)


T, S, q = map(int, input().split())
ans = 0
while S < T:
    S *= q
    ans += 1
print(ans)

T,S,q=list(map(int,input().split()))
ans=1
p=0
while True:
   S=S+(q-1)
   p+=q
   #rint(S,p)   
   if S>=T: break
   if p>=S: p=0; ans+=1
   
print(ans)


T,S,q=list(map(int,input().split()))
a=0
while T>S:S*=q;a+=1
print(a)


T,S,q=list(map(int,input().split()));a=0
while T>S:S*=q;a+=1
print(a)


t, s, q = map(int, input().split())
ans = 1
while s * q < t:
    ans += 1
    s *= q
print(ans)

t,s,q = input().split()
t=int(t)
s=int(s)
q=int(q)
r=s
m=1
while(r<t):
    r=r*q
    if(r<t):
        m+=1
print(m)


t, s, q = list(map(int, input().split()))
lecture = 0
sol = 1
pas = 1-1/q
piste = s
while piste < t:
	x = q*(piste-lecture)
	if piste+x*pas < t:
		sol += 1
		piste += x*pas
		lecture = 0
	else:
		break
print(sol)


t, s, q = map(int, input().split())
i = 0
while(s < t):
    s *= q; i += 1
print(i)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time
import math

(T, S, q) = (int(i) for i in input().split())
start = time.time()

ans = math.ceil(math.log(T/S, q))
print(ans)
#finish = time.time()
#print(finish - start)