#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--;
}
if(B<C){
    packets--;
}
if(C<D){
    packets--;
}
if(A*A*A+B*B*B<=C*D*D&&packets>1){
    packets--;
}
if(A*A*A+C*C*C<=D*D*D&&packets>1){
    packets--;
}
if(A*A*A+D*D*D<=E*E*E&&packets>1){
    packets--;
}
if(B*B*B+C*C*C<=D*D*D&&packets>1){
    packets--;
}
if(B*B*B+C*C*C+D*D*D<=E*E*E&&packets>1){
    packets--;
}
if(C*C*C+D*D*D<=E*E*E&&packets>1){
    packets--;
}
cout<<packets;
return 0;
}