﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

namespace EvenDifferences
{
    class Program
    {
        static void Main()
        {
            string input = Console.ReadLine();
            string[] inputNumbersAsStr = input.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            BigInteger[] inputNumbers = ConvertToIntArray(inputNumbersAsStr);
            List<BigInteger> absoluteDifferences = new List<BigInteger>();
            int currentPosition = 1;
            BigInteger sum = 0;

            if (inputNumbers.Length == 2)
            {
                sum = FindAbsoluteDifference(inputNumbers[currentPosition], inputNumbers[currentPosition - 1]);
                if (sum % 2 == 0)
                {
                    Console.WriteLine(sum);
                    return;
                }
                else
                {
                    Console.WriteLine(0);
                    return;
                }
            }

            while (currentPosition <= inputNumbers.Length - 1)
            {
                BigInteger currentAbsoluteDiff = FindAbsoluteDifference(inputNumbers[currentPosition], inputNumbers[currentPosition - 1]);
                absoluteDifferences.Add(currentAbsoluteDiff);

                if (currentAbsoluteDiff % 2 == 0)
                {
                    currentPosition += 2;
                }
                else
                {
                    currentPosition += 1;
                }
            }

            for (int i = 0; i < absoluteDifferences.Count; i++)
            {
                if (absoluteDifferences[i] % 2 == 0)
                {
                    sum += absoluteDifferences[i];
                }
            }

            Console.WriteLine(sum);
        }

        private static BigInteger FindAbsoluteDifference(BigInteger a, BigInteger b)
        {
            BigInteger largerNumber = a > b ? a : b;
            BigInteger smallerNumber = a > b ? b : a;

            return largerNumber - smallerNumber;
        }

        private static BigInteger[] ConvertToIntArray(string[] arr)
        {
            BigInteger[] numbers = new BigInteger[arr.Length];
            for (int i = 0; i < arr.Length; i++)
            {
                numbers[i] = BigInteger.Parse(arr[i]);
            }

            return numbers;
        }
    }
}
