#include #define Endl putchar('\n') #define D(x) cerr<<"D:"<<__LINE__<<' '<<#x<<':'<'9') {if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+(ch^48),ch=getchar();return x*f;} inline void write(ll x){if(x>9)write(x/10);putchar(x%10+'0');return;} const int N=2e5+20; const ll INF=9e18; inline ll pw(ll x,ll y){ ll res=1; while(y){ if(y&1)res=res*x; x=x*x; y>>=1; if(res>INF||x>INF)return INF; } return res; } inline pair _get(ll x,ll y){ ll l=0,r=INF,res=0; while(l<=r){ ll mid=l+r>>1; if(pw(mid,y)==x)return {mid,mid}; if(pw(mid,y)y?y:x; } int main(){ // freopen("dice.in","r",stdin); // freopen("dice.out","w",stdout); ll x=read(),y=read(),n=read(); if(n==1){ cout<<0<<'\n'; return 0; } n--; ll res=INF; for(int i=1;i<=64;i++){ // if(i>n)break; pair p=_get(n,i); // cout<a?k+1:k); cnt+=f*(j>a?k+1:k); f=cnt; } // cout<<"update:"<