6173 - 例4.4 香甜的黄油
时间限制 : 1 秒
内存限制 : 128 MB


输入

输出
一行:输出奶牛必须行走的最小距离和。
样例
输入
3 4 5 2 3 4 1 2 1 1 3 5 2 3 7 2 4 3 3 4 5
输出
8
来源
一本通