Aggressive cows

Why I am getting wrong output ?