Given:
Total score of Ethan, E=18 points.
Total score of Michael, M=24 points.
The score for each basket, N=2.
The total points scored by both boys is,

Now, the number of goals scored by both boys is,

Therefore, the number of goals scored altogether by the boys is 21.