7407 - Terror   

Description

You are a bus driver. Someday, you heard about the act of the terror. The rumor says the terrorist will destroy the bus to the campus. (Actually, the truth is to destroy the roads. But you don’t know the truth.) You don’t want to be involved in this accident. So, you call a lot of colleagues who don’t know about the act of the terror to drive the bus from the same source (the company) to the same destination (the campus). You think more bus can confuse the terrorist. Because of safety, you want the paths these buses passed are all road-disjoint. How many road-disjoint paths can buses run at the same time?

Input

Each test case starts with a line containing three integers n(2<=n<=100), and m(1<=m<=1000)  indicating the number of locations on the map, and the number of the roads. Following this are m lines, each containing 2 integers representing the endpoints of the directed road ui, vi (0<=ui,vi . The number of the location of the company and the campus are 0 and n-1.

Output

Output the maximum buses that can run from the company to the campus with all road-disjoint paths.

Sample Input  Download

Sample Output  Download

Tags




Discuss