package yukicoder; import java.util.Scanner; public class N208 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int hx = sc.nextInt(); int hy = sc.nextInt(); int ななめ = Math.min(Math.abs(x), Math.abs(y)); int step; if(hx == hy && Math.abs(hx) <= ななめ){ step = 2; }else if(Math.abs(hx) > ななめ || Math.abs(hy) > ななめ){ step = 1; }else{ step = 0; } System.out.println(Math.max(x, y) + step); } }