Perfect Friends
easy
1. You are given a number n (representing the number of students). Each student will have an id from 0 to n - 1. 2. You are given a number k (representing the number of clubs) 3. In the next k lines, two numbers are given separated by a space. The numbers are ids of students belonging to same club. 4. You have to find in how many ways can we select a pair of students such that both students are from different clubs.
Constraints
None
Format
Input
Input has been managed for you
Output
Check the sample output
Example
Sample Input
7
5
0 1
2 3
4 5
5 6
4 6
Sample Output
16
Question Video