a, b, c, d = list(map(int, input().split()))

t = min(b, d) - max(a, c)

if t < 0:

  print((0))

else:

  print(t)
a, b, c, d = list(map(int, input().split()))



time = [0] * 101



for i in range(a, b + 1):

    time[i] += 1



for i in range(c, d + 1):

    time[i] += 1



ans = 0

for i in time:

    if i == 2:

        ans += 1



print((max(0, ans - 1)))
a, b, c, d = list(map(int, input().split()))
t = min(b, d) - max(a, c)
if t < 0:
    print((0))
else:
    print(t)

a, b, c, d = list(map(int, input().split()))
time = [0] * 101
for i in range(a, b + 1):
    time[i] += 1
for i in range(c, d + 1):
    time[i] += 1
ans = 0
for i in time:
    if i == 2:
        ans += 1
print((max(0, ans - 1)))

-t = min(b, d) - max(a, c) -if t < 0: -    print((0)) -else: -    print(t) +time = [0] * 101 +for i in range(a, b + 1): +    time[i] += 1 +for i in range(c, d + 1): +    time[i] += 1 +ans = 0 +for i in time: +    if i == 2: +        ans += 1 +print((max(0, ans - 1)))