$3n$ people take part in a chess tournament: $n$ girls and $2n$ boys. Each participant plays with each of the others exactly once. There were no ties and the number of games won by the girls is $\displaystyle\frac75$ the number of games won by the boys. How many people took part in the tournament?

Let's think step by step and output the final answer within \boxed{}.
user