#include<bits/stdc++.h>
#include<vector>
#include<set>
#include<algorithm>

using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define T int t, q=0; scanf("%d", &t); while(q++<t)
#define ll long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
ll x,y,z,a=0,b=0,c=0,d=0,sum,ans,total,cnt,n,m,k,p,kase,i;
string s1,s2;
#define N 100001
#define MX 1000000001
vector <ll> v;
map<ll,ll> mp;
set<ll> s;
map<ll,ll> :: iterator itr1, ptr1;
set<ll> :: iterator itr, ptr;

ll tow(ll a, ll b) {
	ll ans = 1;
	for (int i = 0; i < b; i++) {
		ans *= a;
	}
	return ans;
}
ll lcm(ll a, ll b) {
	return (a * b) / __gcd(a, b);
}



//SET PRECIOSION   cout << fixed ;  cout << setprecision(n) << ans << endl;


int main() {
	int r1, r2, c1, c2;
	cin >> r1 >> c1 >> r2 >> c2;
	if (r1 == r2 && c1 == c2) {
		cout << 0;
	} else if ((r1 + c1 == r2 + c2) || (r1 - c1 == r2 - c2) || abs(r1 - r2) + abs(c1 - c2) <= 3) {
		cout << 1;
	} else if (abs(r1 - c1 - r2 + c2) <= 3 || abs(r1 + c1 - r2 - c2) <= 3 || (abs(r1 - r2) + abs(c1 - c2)) % 2 == 0 || abs(r1 - r2) + abs(c1 - c2) <= 6) {
		cout << 2;
	} else cout << 3;
	return 0;
}
// Happy Coding  (:


#include<bits/stdc++.h>
using namespace std;

typedef long long int     ll;
typedef long double       ld;
typedef pair<int, int>    pii;
typedef vector<pii>       vpii;
typedef vector<int>       vi;

typedef pair<ll, ll>      pll;
typedef vector<pll>       vpll;
typedef vector<ll>        vl;

#define pb                push_back
#define mk                make_pair
#define mod               (int)1e9+7
#define inf               (ll)1e18
#define endl              "\n"
#define vs                vector<string>
#define ump               unordered_map
#define mp                map
#define pq_max            priority_queue<ll>
#define pq_min            priority_queue<ll,vi,greater<ll> >
#define ff                first
#define ss                second
#define mid(l, r)         (l+(r-l)/2)
#define loop(i, a, b)     for(int i = (a); i <= (b); i++)
#define looprev(i, a, b)  for(int i = (a); i >= (b); i--)
#define print(arr, a, b)  for(int i = (a); i <= (b); i++) cout << arr[i] << " ";
#define scan(arr, a, b)   for(int i = (a); i <= (b); i++) cin >> arr[i];


void file_i_o() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}



int main ()
{
	file_i_o();

	vector<int> v(3);

	loop(i, 0, 2) {
		cin >> v[i];
	}

	sort(v.begin(), v.end());

	if (v[0] + v[2] == 2 * v[1]) cout << "Yes\n";
	else cout << "No\n";


	return 0;
}