import java.io.{BufferedReader, InputStream, InputStreamReader, PrintWriter}
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.{abs, max, min}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}

object Main {
  val MOD = 1000000007
  val out = new PrintWriter(System.out)
  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val A, B, C = sc.nextInt()
    val Max = max(max(A, B), C)
    val ABC = ListBuffer(A, B, C)
    ABC -= Max
    val Seq(x, y) = ABC
    val dx = Max - x
    val dy = Max - y
    val odd = dx % 2 + dy % 2 match {
      case 0 => 0
      case 1 => 2
      case 2 => 1
    }
    val ans = dx / 2 + dy / 2 + odd

    out.println(ans)
  }


  def main(args: Array[String]): Unit = {
    solve()
    out.flush()
  }


  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = null

    def next: String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next.toInt
    def nextLong(): Long = next.toLong
    def nextChar(): Char = next.charAt(0)
  }

  private def rep(n: Int)(f: Int => Unit): Unit = {
    (0 until n) foreach f
  }

  private def map[@specialized(Int, Long) A](n: Int)(f: Int => A): Seq[A] = {
    (0 until n) map f
  }
}
