The problem statement tells you "7 friends were playing basketball".
_____
It appears 5 friends were only playing basketball, 2 friends were playing basketball and having snacks, and 3 friends were only having snacks. Apparently, 10 friends were doing neither of those activities.