B. Trip Counting II
time limit per test
4 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4 4
1 2
2 3
3 4
1 4
Output
8
Input
4 6
1 2
1 3
1 4
2 3
2 4
3 4
Output
24