#include #define ll long long #define Mod 998244353 #define Mod1 10000000000037 #define ls node[x].lch #define rs node[x].rch #define inf 0x7fffffff #define inf1 1000000009 #define ull unsigned long long #define llinf 0x7fffffffffffffff #define llinf1 1000000000000000009 #define IOS ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL); #define F(a,b,c,d) for(int b=c;b<=d;b+=a) #define F2(a,b,c,d) for(int b=c;b>=d;b-=a) #define PRC(b,a) fixed< inline void read(T &xx){ char cc=getchar();T ff=1; xx=0; while(cc>'9'||cc<'0'){ ff=cc=='-'?-1:ff,cc=getchar();} while(cc<='9'&&cc>='0'){ xx=(xx<<1)+(xx<<3)+(cc^48),cc=getchar();} xx=xx*ff; } template inline void write(T xx){ if(xx<0){ putchar('-'),xx=-xx;} if(xx>9) write(xx/10); putchar(xx%10+'0'); } inline ll lowbit(ll xx){return xx&(-xx);} inline ll Gcd(ll xx,ll yy){return yy?Gcd(yy,xx%yy):xx;} inline ll q_Mul(ll xx,ll yy,ll pp){ll oo=0;while(yy){if(yy&1)oo=(oo+xx)%pp;xx=(xx<<1)%pp;yy>>=1;}return oo;} inline ll q_Pow(ll xx,ll yy,ll pp){ll oo=1;for(;yy;yy>>=1,xx=xx*xx%pp)yy&1?oo=oo*xx%pp:0;return oo;} //q_Pow can conbine with q_Mul to avoid overflow template inline T Min(T xx,T yy){return xx inline T Max(T xx,T yy){return xx>yy?xx:yy;}//(XX-YY>>63)?.:.; template inline void read(T1 &x,T2& ...y){read(x);read(y...);} inline void Cout(){cout< inline void Cout(T1 x,T2 ...y){cout<>=1; return res; } inline void dfs(int x,int v){ if(x<1||x>n||a[x]<=v&&a[x]!=-1) return; a[x]=v; if(x==n) return; int p=count(x); dfs(x+p,v+1); dfs(x-p,v+1); } signed main(){ //freopen(); //freopen(); IOS //int T; memset(a,-1,sizeof(a)); cin>>n; dfs(1,1); cout<