Valera the Horse is going to the party with friends. He has been following the fashion trends for a while, and he knows that it is very popular to wear all horseshoes of different color. Valera has got four horseshoes left from the last year, but maybe some of them have the same color. In this case he needs to go to the store and buy some few more horseshoes, not to lose face in front of his stylish comrades.

Fortunately, the store sells horseshoes of all colors under the sun and Valera has enough money to buy any four of them. However, in order to save the money, he would like to spend as little money as possible, so you need to help Valera and determine what is the minimum number of horseshoes he needs to buy to wear four horseshoes of different colors to a party.

Input

The first line contains four space-separated integers s1, s2, s3, s4 (1 ≤ s1, s2, s3, s4 ≤ 109) — the colors of horseshoes Valera has.

Consider all possible colors indexed with integers.

Output

Print a single integer — the minimum number of horseshoes Valera needs to buy.

Examples

Input

1 7 3 3


Output

1


Input

7 7 7 7


Output

3


import java.io.*;
import java.util.*;


public class CF {
	
	static class Pair{
	int a,b;
	public Pair(int a, int b) {
		this.a=a;
		this.b=b;
	}
}

	static class in {
	    static BufferedReader reader;
	    static StringTokenizer tokenizer;

	    /** call this method to initialize reader for InputStream */
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }

	    /** get next word */
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }

	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
		
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }
	}
	
	public static int[] ini(int n)throws IOException {
		
		int[] arr=new int[n];
		for(int i=0;i<n;i++) {
			arr[i]=in.nextInt();
		}
		return arr;
		
	}
	
	public static long[] inl(int n)throws IOException {
		
		long[] arr=new long[n];
		for(int i=0;i<n;i++) {
			arr[i]=in.nextLong();
		}
		return arr;
		
	}
	
	public static int gcd(int a, int b) {
		if(b==0) {
			return a;
		}
		return gcd (b,a%b);
	}
	public static long gcd(long a, long b) {
		if(b==0) {
			return a;
		}
		return gcd (b,a%b);
	}
	public static int lcm(int a, int b) {
		return (a*b)/gcd(a,b);
	}
	public static int max(int[] arr) {
		int max=Integer.MIN_VALUE;
		for(int i=0;i<arr.length;i++) {
			max=Math.max(max, arr[i]);
		}
		return max;
	}
	
	public static long max(long[] arr) {
		long max=Long.MIN_VALUE;
		for(int i=0;i<arr.length;i++) {
			max=Math.max(max, arr[i]);
		}
		return max;
	}
	public static int min(int[] arr) {
		int min=Integer.MAX_VALUE;
		for(int i=0;i<arr.length;i++) {
			min=Math.min(min, arr[i]);
		}
		return min;
	}
	
	public static long min(long[] arr) {
		long min=Long.MAX_VALUE;
		for(int i=0;i<arr.length;i++) {
			min=Math.min(min, arr[i]);
		}
		return min;
	}
	
	public static void reverse(int[] arr, int low, int high) {
		
		int temp;
        while (low<high) {
            temp = arr[low];
            arr[low] = arr[high];
            arr[high] = temp;
            low++;
            high--;
        }
		
	}
	public static void reverse(long[] arr, int low, int high) {
		
		long temp;
        while (low<high) {
            temp = arr[low];
            arr[low] = arr[high];
            arr[high] = temp;
            low++;
            high--;
        }
		
	}
	public static int binarySearch(int arr[], int l, int r, int x)
    {
        if (r >= l) {
            int mid = l + (r - l) / 2;
  
            if (arr[mid] == x)
           
            if (arr[mid] > x)
                return binarySearch(arr, l, mid - 1, x);
  
            return binarySearch(arr, mid + 1, r, x);
        }

        return -1;
    }
	
	public static void swap(char[] arr, int i, int j) {
		
		char x=arr[i];
		arr[i] = arr[j];
		arr[j] = x;
	}
	
	
	public static ArrayList<Integer> sieveOfEratosthenes(int n)
    {
        boolean prime[] = new boolean[n + 1];
        for (int i = 0; i <= n; i++)
            prime[i] = true;
 
        for (int p = 2; p * p <= n; p++)
        {
           
            if (prime[p] == true)
            {
                
                for (int i = p * p; i <= n; i += p)
                    prime[i] = false;
            }
        }

       ArrayList<Integer> lol=new ArrayList<Integer>();
       
       for(int i=2;i<=n;i++) {
    	   if(prime[i] ==true) {
    		   lol.add(i);
    	   }
       }
       
       return lol;
    }
	
	
	static boolean isPrime(int n)
    {
    
        if (n <= 1) return false;
     
        
        for (int i = 2; i < Math.sqrt(n); i++)
            if (n % i == 0)
                return false;
     
        return true;
    }

	
	
	
	
	
	
	
	/**************************************************************************************/
	
	
	
	
	
	public static void solve() {
		
	}
	
	
	
	

	public static void main(String[] args)throws IOException {
		// TODO Auto-generated method stub
		in.init(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		
		HashSet<Integer> set=new HashSet<Integer>();
		
		for(int i=0;i<4;i++) {
			set.add(in.nextInt());
		}
		
		System.out.println(4-set.size());
	
		pw.flush();
		
		pw.close();
		
	}

}
