#include<iostream>
using namespace std;
int main(){
int A, B, C, D, E;
cin>>A>>B>>C>>D>>E;
int packets=4;
if(A<B){
    packets=packets-1;
}
if(B<C){
    packets=packets-1;
}
if(C<D){
    packets=packets-1;
}
if(A==B&&2*A<=C){
    packets--;
}
if(C==B&&2*C<=D){
    packets--;
}
if(C==D&&2*D<=E){
    packets--;
}
cout<<packets;
return 0;
}