https://www.luogu.com.cn/record/144282269
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define ve vector
#define endl '\n'
#define itn int
using namespace std;
ll n;
bool end=0;
void dfs(ll a,ll b,int k){
if(end)return;
if(a==n or b==n){
cout<<k;
end=1;
return;
}
dfs(a+b,a,k+1);
dfs(a,a+b,k+1);
}
int main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin>>n;
dfs(1,1,0);
return 0;
}