include
using namespace std;
const long int mod=19260817;
int main()
{
long long int fib[100002]={0,1,2};
int hash[19260817];
hash[1]=1,hash[2]=2;
for(int i=3;i<100002;i++){
fib[i]=(fib[i-1]+fib[i-2])%mod;
hash[fib[i]]=i;
}
string str;
while(cin>>str){
int number=0;
for(int i=0;i<str.size();i++){
number=(number*10+str[i]-'0')%mod;
}
cout<<hash[number]<<endl;
}
}
暴力膜不可取