#!/usr/bin/env python #coding:UTF-8 px,py = map(int,raw_input().split()) qx,qy = map(int,raw_input().split()) x = (px - qx) / 2 y = (py - qx) / 2 result = x + y print result