import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { int count = 0,find=0; int i_ul=0,i_ur=0,i_r=0,i_lr=0,i_ll=0,i_l=0; int j_ul=0,j_ur=0,j_r=0,j_lr=0,j_ll=0,j_l=0; int printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { if((i_start>n-1)||(j_start>n-1)) { return 0; } else if((i_start==i_end)&&(j_start==j_end)) { find++; System.out.println(count); return 1; } else { count++; i_ul=i_start-2; j_ul=j_start-1 ; printShortestPath(n,i_ul,j_ul,i_end,j_end); i_ur=i_start-2; j_ur=j_start+1 ; printShortestPath(n,i_ur,j_ur,i_end,j_end); i_r=i_start; j_r=j_start+2 ; printShortestPath(n,i_r,j_r,i_end,j_end); i_lr=i_start+2; j_lr=j_start+1 ; printShortestPath(n,i_lr,j_lr,i_end,j_end); i_ll=i_start+2; j_ll=j_start-1 ; printShortestPath(n,i_ll,j_ll,i_end,j_end); i_l=i_start; j_l=j_start-2 ; printShortestPath(n,i_l,j_l,i_end,j_end); } return find; } int getfind() { return find; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int i_start = in.nextInt(); int j_start = in.nextInt(); int i_end = in.nextInt(); int j_end = in.nextInt(); Solution o=new Solution(); int c= o.printShortestPath(n, i_start, j_start, i_end, j_end); //int c=o.getfind(); if(c==0) { System.out.println("Impossible"); } in.close(); } }