import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No0208 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int x = abs(in.nextInt()); int y = abs(in.nextInt()); in.nextInt(); in.nextInt(); out.println((x+y-min(x,y))); } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); in.close(); out.close(); } static void trace(Object... o) { System.out.println(deepToString(o));} }