A jar contains ten blue balls, ten red ones, ten white ones, and ten green ones. Each set of ten balls of the same colour is numbered from 1 to 10. How many different selections of four balls are possible if exactly three of the balls bear the same numbers?

The answer's supposed to be 1440.

Can someone show me the steps of solving this problem? Thanks!