#include <iostream> 
using namespace std;
int main() {
    int i,n;
    int count=0;
    int a=2;
    int b=3;
    while (cin>>n) {
        for(i=4;i<=n;i++){
            if(i<a+b){
                count++;
            }
            else{
                a=b;
                b=i;
            }
        }
        cout<<count<<endl;
        count=0;
    a=2;
    b=3;
    }
    return 0;
}