1519 - [POI2006]Ork-Ploughing

Input

Output

一个整数表示最少的耕种次数

Examples

Input

12 6 4
6 0 4 8 0 5
0 4 5 4 6 0
0 5 6 5 6 0
5 4 0 0 5 4

Output

8


The illustration above shows the optimal ploughing of the field from the example.
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题