Each line segment from a red point that goes to either a green point or a blue point has endpoints of different colors.
There are 7 segments from each red point and there are 5 red points, for a total of 35 segments.
Each line segment from a green point that goes to either a red point or a blue point has endpoints of different colors.
There are 8 segments from each green point and there are 4 green points, for a total of 32 segments.
Each line segment from a blue point that goes to either a green point or a red point has endpoints of different colors.
There are 9 segments from each blue point and there are 5 blue points, for a total of 27 segments.
Adding these together, we get 35 + 32+ 27 = 94 segments.
However, we have counted each segment twice, so we need to divide that answer by 2: 47 segments.