QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 64 MB Points totaux : 100 Difficulté: [afficher]

#16442. Ball

Statistiques

A school is holding a dance. It is known that among the $n$ students in the school, some have danced with each other before. Naturally, a pair of students who dance together must consist of one boy and one girl. At this dance, any pair of invited students who have danced together before cannot dance with each other. Find the maximum number of students that can be invited to the dance.

Input

The first line contains $n$ and $m$, where $n$ is the total number of available students and $m$ is the number of pairs of students known to have danced together ($n \le 1000$, $m \le 2000$). The following $m$ lines each contain two non-negative integers, representing that the two students with these IDs have danced together before. Student IDs range from $0$ to $n-1$.

Output

The output file contains only one line, which is a single integer representing the maximum number of students that can be invited.

Examples

Input 1

8 6
0 2
2 3
3 5
1 4
1 6
3 1

Output 1

5

Input 2

20 5
5 2
4 3
18 17
0 11
13 3

Output 2

16

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.