Job Assignment 3

No attempts yetTime limit3sMemory limit256 MB

Problem

Gangho's company has NN employees and MM jobs to finish. Employees are numbered 1 to NN, and jobs are numbered 1 to MM.

Each employee takes one job out of the jobs that employee can do, and each job is taken by one employee. KK of the NN employees can take up to two jobs.

Given the list of jobs each employee can do, write a program that finds the largest number of the MM jobs the company can finish.

Input

The first line contains the number of employees NN, the number of jobs MM, and the number of employees who can take two jobs KK. (1N,M10001 \le N, M \le 1000, 1KN1 \le K \le N)

Each of the next NN lines describes one employee. The ii-th line contains the number of jobs employee ii can do, followed by the numbers of those jobs.

Output

Print the largest number of jobs Gangho's company can finish.

Note

In the first example, employee 1 takes two jobs. Employee 1 takes jobs 1 and 2, employee 2 takes job 3, and employee 3 takes job 5, so four jobs are finished.