i want to count the no of variables that are same in an array please help me out