#include <bits/stdc++.h>



using namespace std;

int ans = 0;

main()
{
    int a, b, c;

    cin >> a >> b >> c;

    int mx = a, mn = b, mid;

    mx = max(mx, max(b, c));
    mn = min(mn, min(a, c));

    if (a != mx && a != mn)
        mid = a;
    if (b != mx && b != mn)
        mid = b;
    if (c != mx && c != mn)
        mid = c;
    if ((mid - mn) % 2 != 0)
    {
        ans++;
        mx++;
        mn++;
    }
    ans += (mid - mn) / 2;
    ans += (mx - mid);
    cout << ans;
}


