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

if(A==B&&3*A*A*A<=C*C*C){
    packets--;
}
if(C==B&&3*C*C*C<=D*D*D){
    packets--;
}
if(C==D&&3*D*D*D<=E*E*E){
    packets--;}

if(A==B&&4*A*A*A<=C*C*C){
    packets--;
}
if(C==B&&4*C*C*C<=D*D*D){
    packets--;
}
if(C==D&&4*D*D*D<=E*E*E){
    packets--;
}
cout<<packets;
return 0;
}