import java.util.Scanner; public class HelloWorld { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int[] xy_initial = new int[2]; int[] xy_goal = new int[2]; xy_initial[0] = sc.nextInt(); xy_initial[1] = sc.nextInt(); xy_goal[0] = sc.nextInt(); xy_goal[0] = sc.nextInt(); sc.close(); if (Math.abs(xy_goal[0] - xy_initial[0]) + Math.abs(xy_goal[1] - xy_initial[1]) > 3) { System.out.println(2); }else { System.out.println(1); } } }