#include using namespace std; typedef long long ll; ll mod = 1e9+7; // 1e9+9 ll add(ll x,ll y){return (x+y)%mod;} ll mul(ll x,ll y){return (x*y)%mod;} ll mypow(ll x,ll y){ ll v=1; for(;y;x=mul(x,x),y>>=1) if(y&1)v=mul(v,x); return v; } ll divi(ll x,ll y){return mul(x,mypow(y,mod-2));} ll fact[10000000]={}, factc=0; ll Fact(ll x){ fact[0]=1; while( factc < x ){ factc++; fact[factc]=mul( fact[factc-1] , factc ); } return fact[x]; } ll nCr(ll n,ll r){ return divi( Fact(n) , mul( Fact(n-r) , Fact(r) ) ); } ll nHr(ll n,ll r){ return nCr( n+r-1 , n ); } ll N,K,D; int main(){ cin>>N>>K>>D; ll cc=0; while(N>=K){ N-=(K-1); cc++; } if(D==1){ cout<