On a website, there are M users and they want to change their names. You will be given M lines consisting of two strings A and B, where username A wants to change his username to B. But the website does not support multiple users with the same username that is No two users can have the same username at the same time. A user can change his username from his current name to any name (X) if there is no user named X.
Every change in the username costs 1 unit of money. Find minimum cost to achieve these changes.
Notes
Input format
Output format
For each test case:
Constraints
This will require four units: