Language: C++

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;

class Main implements Runnable {
	public static final long MOD = 1000000007;
	private final FastScanner sc;
	private final PrintWriter out;
	int a,b,c;

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t,e)->System.exit(1));
		new Thread(null, new Main(), "", 16L * 1024 * 1024).start();
	}

	Main() {
		sc = new FastScanner();
		out = new PrintWriter(System.out);
	}
	
	private void init() throws Exception{
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
	}
	private void solve() throws Exception{
		int max = Math.max(a, Math.max(b, c));
		int cnt = (max - a) + (max - b) + (max - c);
		while(cnt%2!=0){
			cnt+=3;
		}
		out.println(cnt/2);
	}
	
	/*
	private void exit(int status){
		out.flush();
		out.close();
		System.exit(status);
	}
	//*/
	public void run() {
		try{
			init();
			solve();
		}catch(Exception e){
			e.printStackTrace();
		}
		out.flush();
		out.close();
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean read() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
			return true;
		}
	}

	private boolean hasNext() {
		while (read() && !isVisibleChar(buffer[ptr]))
			ptr++;
		return read();
	}

	private int getNextChar() {
		if (read()) {
			ptr++;
			return buffer[ptr - 1];
		} else {
			return -1;
		}
	}

	private static boolean isVisibleChar(int code) {
		return code >= 33 && code <= 126;
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = getNextChar();
		while (isVisibleChar(b)) {
			sb.appendCodePoint(b);
			b = getNextChar();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean sign = true;
		int b = getNextChar();
		if (b == '-') {
			sign = false;
			b = getNextChar();
		}
		if (b < '0' || b > '9') {
			throw new NumberFormatException();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isVisibleChar(b)) {
				return sign ? n : -n;
			} else {
				throw new NumberFormatException();
			}
			b = getNextChar();
		}
	}

	public int nextInt() {
		long n = nextLong();
		if (n < Integer.MIN_VALUE || n > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) n;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public void close() {
		try {
			in.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

class IntQueue {
	protected int[] a;
	protected int head, tail;

	public IntQueue(int max) {
		a = new int[max];
	}

	public void offer(int x) {
		a[tail++] = x;
	}

	public int poll() {
		return a[head++];
	}

	public int peek() {
		return a[head];
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.IOException;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.InputStream;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.PrintWriter;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Arrays;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.NoSuchElementException;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:23: error: expected initializer before 'Runnable'
    7 | class Main implements Runnable {
      |                       ^~~~~~~~
a.cc:57:16: error: expected ':' before 'final'
   57 |         private final InputStream in = System.in;
      |                ^~~~~~
      |                :
a.cc:57:17: error: 'final' does not name a type
   57 |         private final InputStream in = System.in;
      |                 ^~~~~
a.cc:58:16: error: expected ':' before 'final'
   58 |         private final byte[] buffer = new byte[1024];
      |                ^~~~~~
      |                :
a.cc:58:17: error: 'final' does not name a type
   58 |         private final byte[] buffer = new byte[1024];
      |                 ^~~~~
a.cc:59:16: error: expected ':' before 'int'
   59 |         private int ptr = 0;
      |                ^~~~
      |                :
a.cc:60:16: error: expected ':' before 'int'
   60 |         private int buflen = 0;
      |                ^~~~
      |                :
a.cc:62:16: error: expected ':' before 'boolean'
   62 |         private boolean read() {
      |                ^~~~~~~~
      |                :
a.cc:62:17: error: 'boolean' does not name a type; did you mean 'bool'?
   62 |         private boolean read() {
      |                 ^~~~~~~
      |                 bool
a.cc:79:16: error: expected ':' before 'boolean'
   79 |         private boolean hasNext() {
      |                ^~~~~~~~
      |                :
a.cc:79:17: error: 'boolean' does not name a type; did you mean 'bool'?
   79 |         private boolean hasNext() {
      |                 ^~~~~~~
      |                 bool
a.cc:85:16: error: expected ':' before 'int'
   85 |         private int getNextChar() {
      |                ^~~~
      |                :
a.cc:94:16: error: expected ':' before 'static'
   94 |         private static boolean isVisibleChar(int code) {
      |                ^~~~~~~
      |                :
a.cc:94:24: error: 'boolean' does not name a type; did you mean 'bool'?
   94 |         private static boolean isVisibleChar(int code) {
      |                        ^~~~~~~
      |                        bool
a.cc:98:15: error: expected ':' before 'String'
   98 |         public String next() {
      |               ^~~~~~~
      |               :
a.cc:98:16: error: 'String' does not name a type
   98 |         public String next() {
      |                ^~~~~~
a.cc:110:15: error: expected ':' before 'long'
  110 |         public long nextLong() {
      |               ^~~~~
      |               :
a.cc:136:15: error: expected ':' before 'int'
  136 |         public int nextInt() {
      |               ^~~~
      |               :
a.cc:143:15: error: expected ':' before 'double'
  143 |         public double nextDouble() {
      |               ^~~~~~~
      |               :
a.cc:147:15: error: expected ':' before 'void'
  147 |         public void close() {
      |               ^~~~~
      |               :
a.cc:154:2: error: expected ';' after class definition
  154 | }
      |  ^
      |  ;
a.cc: In member function 'int FastScanner::getNextChar()':
a.cc:86:21: error: 'read' was not declared in this scope
   86 |                 if (read()) {
      |                     ^~~~
a.cc:88:32: error: 'buffer' was not declared in this scope; did you mean 'buflen'?
   88 |                         return buffer[ptr - 1];
      |                                ^~~~~~
      |                                buflen
a.cc: In member function 'long int FastScanner::nextLong()':
a.cc:111:22: error: 'hasNext' was not declared in this scope
  111 |                 if (!hasNext())
      |                      ^~~~~~~
a.cc:112:35: error: expected type-specifier before 'NoSuchElementException'
  112 |                         throw new NoSuchElementException();
      |                                   ^~~~~~~~~~~~~~~~~~~~~~
a.cc:114:17: error: 'boolean' was not declared in this scope; did you mean 'bool'?
  114 |                 boolean sign = true;
      |                 ^~~~~~~
      |                 bool
a.cc:117:25: error: 'sign' was not declared in this scope; did you mean 'signed'?
  117 |                         sign = false;
      |                         ^~~~
      |                         signed
a.cc:121:35: error: expected type-specifier before 'NumberFormatException'
  121 |                         throw new NumberFormatException();
      |                                   ^~~~~~~~~~~~~~~~~~~~~
a.cc:127:48: error: 'isVisibleChar' was not declared in this scope
  127 |                         } else if (b == -1 || !isVisibleChar(b)) {
      |                                                ^~~~~~~~~~~~~
a.cc:128:40: error: 'sign' was not declared in this scope; did you mean 'signed'?
  128 |                                 return sign ? n : -n;
      |                                        ^~~~
      |                                        signed
a.cc:130:43: error: expected type-specifier before 'NumberFormatException'
  130 |                                 throw new NumberFormatException();
      |                                           ^~~~~~~~~~~~~~~~~~~~~
a.cc: In member function 'int FastScanner::nextInt()':
a.cc:138:25: error: 'Integer' was not declared in this scope
  138 |                 if (n < Integer.MIN_VALUE || n > Integer.MAX_VALUE)
      |                         ^~~~~~~
a.cc:139:35: error: expected type-specifier before 'NumberFormatException'
  139 |                         throw new NumberFormatException();
      |                                   ^~~~~~~~~~~~~~~~~~~~~
a.cc: In member function 'double FastScanner::nextDouble()':
a.cc:144:24: error: 'Double' was not declared in this scope; did you mean 'double'?
  144 |                 return Double.parseDouble(next());
      |                        ^~~~~~
      |                        double
a.cc:144:43: error: 'next' was not declared in this scope; did you mean 'nextInt'?
  144 |                 return Double.parseDouble(next());
      |                                           ^~~~
      |                                           nextInt
a.cc: In member function 'void FastScanner::close()':
a.cc:149:25: error: 'in' was not declared in this scope; did you mean 'int'?
  149 |                         in.close();
      |                         ^~
      |                         int
a.cc:150:26: error: 'IOException' does not name a type
  150 |                 } catch (IOException e) {
      |                          ^~~~~~~~~~~
a.cc:151:25: error: 'e' was not declared in this scope
  151 |                         e.printStackTrace();
      |                         ^
a.cc: At global scope:
a.cc:157:18: error: expected ':' before 'int'
  157 |         protected int[] a;
      |                  ^~~~
      |                  :
a.cc:157:22: error: expected unqualified-id before '[' token
  157 |         protected int[] a;
      |                      ^
a.cc:158:18: error: expected ':' before 'int'
  158 |         protected int head, tail;
      |                  ^~~~
      |                  :
a.cc:160:15: error: expected ':' before 'IntQueue'
  160 |         public IntQueue(int max) {
      |               ^~~~~~~~~
      |               :
a.cc:164:15: error: expected ':' before 'void'
  164 |         public void offer(int x) {
      |               ^~~~~
      |               :
a.cc:168:15: error: expected ':' before 'int'
  168 |         public int poll() {
      |               ^~~~
      |               :
a.cc:172:15: error: expected ':' before 'int'
  172 |         public int peek() {
      |               ^~~~
      |               :
a.cc:175:2: error: expected ';' after class definition
  175 | }
      |  ^
      |  ;
a.cc: In constructor 'IntQueue::IntQueue(int)':
a.cc:161:17: error: 'a' was not declared in this scope
  161 |                 a = new int[max];
      |                 ^
a.cc: In member function 'void IntQueue::offer(int)':
a.cc:165:17: error: 'a' was not declared in this scope
  165 |                 a[tail++] = x;
      |                 ^
a.cc: In member function 'int IntQueue::poll()':
a.cc:169:24: error: 'a' was not declared in this scope
  169 |                 return a[head++];
      |                        ^
a.cc: In member function 'int IntQueue::peek()':
a.cc:173:24: error: 'a' was not declared in this scope
  173 |                 return a[head];
      |                        ^