Here's your approach:
Define a struct with two fields: home and away.
Read and create an array of team structs.
Read each team's colors into the array.
Initialize a conflict counter to 0.
Outer loop: for each team from 0 to (the host).
Inner loop: for each team from 0 to (the guest).
If and teams[i].home == teams[j].away, increment the counter.
Print the counter. The nested loops check every game. Structs make comparison clean: you access teams[i].home and teams[j].away without juggling separate arrays.