Three dinos go on a camping trip. There they decide to play a game. They mark distances of 1 km each on the ground up to 100 km i.e. 1, 2, 3...100. They can sit only on these 100 spots, with each one at a different spot. In one move, one of the outer dinos can hop into a spot between the other two. 
Help them maximise their duration of play. 


Input
Three numbers(integers), l, m and n (0 < l < m < n < 100), the starting spots of the dinosaurs.


Output
Output the largest number of jumps the dinosaurs can make in all.


Example

Input
4 5 7
Output
1
Input
5 6 11
Output
4
from sys import stdin
a,b,c=map(int,stdin.readline().split())
if c-b>b-a:
    print c-b-1
elif c-b<b-a:
    print b-a-1
else:
    print c-b-1