#import long a,b;main(){while(std::cin>>b)a+=1<<4*b;b=0;while(a/=10)b+=a/15%16>2;std::cout<<1+b;}