1781 - [Usaco2010 Feb]Ice 冰上

Input

  • 第一行: 五个用空格隔开的整数: N, Bx, By, Gx, and Gy * 第二行到第N+1行: 第i+1行用两个空格隔开的整数来描述第i个石头

Output

  • 第一行: 一个整数表示Bessie至少要推多少次石头才能够到达终点

Examples

Input

6 2 1 5 1
5 4
2 3
1 1
6 2
5 0
0 0

Output

3
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题