2292 - 【POJ Challenge 】永远挑战

Input

Output

Examples

Input

3 3
1 2 1
2 3 1
1 3 2

Output

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