#import <stdio.h>
#import <stdlib.h>
int compare_int(const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}
int main(){
    int A[3];
    scanf("%d",A);
    scanf("%d",A+1);
    scanf("%d",A+2);
    qsort(A, 3, sizeof(int), compare_int);
    int z = 0;
    int a = A[1]-A[0];
    int b = A[2]-A[0];
    int r = a%2;
    int s = b%2;
    int result = 0;
    if (r==1 && s==0) {
        z++;
        b++;
        result++;
    }
    if (r==0 && s==1) {
        z++;
        a++;
        result++;
    }
    if (r==1 && s==1) {
        a++;
        b++;
        result++;
    }
    result += (b-z)/2 + (b-a)/2;
    printf("%d",result);
}
