Dreaming of Shapes


Submit solution

Points: 1
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

Your toddler just gave you a drawing, and... well you don't know what it is. "Shapes!" is all they say. "Shapes! Shapes!". But which shapes?

The drawing is made of several points, connected by several, straight lines. A shape is considered a closed loop of unique points, that can be made by tracing over these lines.

For example, the following drawing has 3 unique kinds of shapes:

A 3-sided shape:

A 4-sided shape:

A 5-sided shape:

So there would be 3 unique kinds of shapes overall.

The following drawing has 2 unique kinds of shapes:

There is a 6-sided shape and a 4-sided shape.

Note: Don't worry too much about how the shapes look. All that matters is how many edges are in the loop!

How many shapes can be made from your child's beautiful artwork?

Input

The first line consists of an integer n (1 \leq n \leq 1000), the number of points in the drawing. Each point is numbered from 1 to n.

The second line consists of an integer m (1 \leq m \leq 1000), the number of lines in the drawing.

The next m lines are in the form a \; b, indicating that there is a line between points a and b.

Output

Output the number of unique shapes you can make from the drawing, by tracing over a continuous path.

Example

Input
5
6
1 2
1 3
2 4
2 5
3 4
4 5
Output
3

See the first example above for an explanation, this is the same shape.

Input
6
7
1 2
2 3
3 4
4 5
5 6
6 1
1 4
Output
2

See the second example above for an explanation, this is the same shape.


Comments

There are no comments at the moment.