package no208; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int x2 = sc.nextInt(); int y2 = sc.nextInt(); if (!jama(x,y,x2,y2)) { System.out.println(Math.max(Math.abs(x), Math.abs(y))); }else{ System.out.println(Math.max(Math.abs(x), Math.abs(y)) + 1); } } public static boolean jama(int x,int y,int x2,int y2) { if (Math.abs(x) != Math.abs(y)) { return false; } if (Math.abs(x2) != Math.abs(y2)) { return false; } return x * x2 >= 0 && y * y2 >= 0; } }