Miser is a manager of a services company. N employees work under him who gets paid for each task they complete. His company recently has got N tasks to complete. He plans to assign single task to each of his employee so that all the work can be completed faster.
Like his name suggests, Miser doesn't want to spend money or wants to spend least to get his work done. He continues the same behaviour, plans to get his N tasks done with minimum cost. He calls all his employees and tells them about the tasks. He asks them to tell the amount they would take for each task.
Now he would give the details to you and wants you to calculate the least amount he has to spend to get all the tasks done with a condition that each employee gets only one task. Being a miser he would not pay you for doing his work but would gift you with a green tick.
Input Format:
First line has an integer N(number of employees and also number of tasks).
Next N lines have N space separated integers. jth number in ith line represents cost set by ith employee for jth task.
Output Format:
Print the minimum cost as mentioned in problem statement.
Constraints:
For minimizing cost in,
A B C
1 4 15 20
2 7 10 19
3 7 20 4
assign task A to person 1, task B to person 2 and task C to person 3.
Total cost = 4+10+4=18.