Robin had 40 apples to give to 3 groups of children.

The first group ate 1/8 of the total apples.

The second group ate 4 of the total apples.

The third group ate 20% of the total apples.

How many apples were left?​