3197 - [Sdoi2013]assassin

Input

Output

Examples

Input

4
1 2
2 3
3 4
0 0 1 1
1 0 0 0 

Output

1
时间限制 1 秒
内存限制 128 MB
统计
上一题 下一题