Time limit
1s
Memory limit
128 MB
Han Yoonjung and her friends went to Italy during vacation. Because the weather was hot, they decided to eat ice cream.
The shop sells N kinds of ice cream, numbered from 1 to N. Some pairs of flavors taste bad when chosen together.
Yoonjung wants to choose 3 different kinds of ice cream while avoiding every bad pair. Count how many choices are possible.
The first line contains the number of ice cream kinds N and the number of forbidden pairs M.
Each of the next M lines contains two ice cream numbers that must not be chosen together. The same pair is not given more than once.
1 <= N <= 2000 <= M <= 10,000Print the total number of possible choices.
Suppose there are 5 kinds of ice cream and the forbidden pairs are (1, 2), (3, 4), and (1, 3). The possible choices are (1, 4, 5), (2, 3, 5), and (2, 4, 5), so there are 3 choices.