Polycarp takes part in a quadcopter competition. According to the rules a flying robot should:

  start the race from some point of a field,  go around the flag,  close cycle returning back to the starting point. 

Polycarp knows the coordinates of the starting point (x_1, y_1) and the coordinates of the point where the flag is situated (x_2, y_2). Polycarp’s quadcopter can fly only parallel to the sides of the field each tick changing exactly one coordinate by 1. It means that in one tick the quadcopter can fly from the point (x, y) to any of four points: (x - 1, y), (x + 1, y), (x, y - 1) or (x, y + 1).

Thus the quadcopter path is a closed cycle starting and finishing in (x_1, y_1) and containing the point (x_2, y_2) strictly inside.

 [Image] The picture corresponds to the first example: the starting (and finishing) point is in (1, 5) and the flag is in (5, 2). 

What is the minimal length of the quadcopter path?


-----Input-----

The first line contains two integer numbers x_1 and y_1 ( - 100 ≤ x_1, y_1 ≤ 100) — coordinates of the quadcopter starting (and finishing) point.

The second line contains two integer numbers x_2 and y_2 ( - 100 ≤ x_2, y_2 ≤ 100) — coordinates of the flag.

It is guaranteed that the quadcopter starting point and the flag do not coincide.


-----Output-----

Print the length of minimal path of the quadcopter to surround the flag and return back.


-----Examples-----
Input
1 5
5 2

Output
18

Input
0 1
0 0

Output
8

Difficulty: competition

Starter code:

Solutions:
Q = input().split(" ")
F = input().split(" ")
xQ = int(Q[0])
yQ = int(Q[1])
xF = int(F[0])
yF = int(F[1])

if xQ == xF:
    print((abs(yQ-yF)+1)*2+4)
elif yQ == yF:
    print((abs(xQ-xF)+1)*2+4)
else:
    print((abs(xQ-xF)+1)*2+(abs(yQ-yF)+1)*2)


x1,y1=map(int,input().split())
x2,y2=map(int,input().split())
dx=max(2,abs(x1-x2)+1)
dy=max(2,abs(y1-y2)+1)
print(2*dx+2*dy)

import math
import re


def ria():
    return [int(i) for i in input().split()]


def ri():
    return int(input())


def rfa():
    return [float(i) for i in input().split()]


eps = 1e-9


def is_equal(a, b):
    return abs(a - b) <= eps


def distance(p0, p1):
    return math.sqrt((p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2)


xq, yq = ria()
xp, yp = ria()
ar = [(xp + 1, yp+1), (xp - 1, yp-1), (xp-1, yp + 1), (xp+1, yp - 1)]

if xp == xq:
    print(2 * 2 + (abs(yp - yq) + 1) * 2)
    return
if yp == yq:
    print(2 * 2 + (abs(xp - xq) + 1) * 2)
    return
mni = 1e+9

for i in ar:
    x1, y1 = i
    mxx, mxy, mnx, mny = max(x1, xq), max(y1, yq), min(x1, xq), min(y1, yq)
    #print(mxx,mxy,mnx,mny)
    if mxx > xp and mxy > yp and mnx < xp and mny < yp:
        mni = min(mni, (mxx - mnx) * 2 + (mxy - mny) * 2)
print(mni)


import math
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
if x1 == x2:
    ans = 2*abs(y1-y2)+6
elif y1 == y2:
    ans = 2*abs(x1-x2)+6
else:
    ans = 2 * (abs(x1 - x2) + 1 + abs(y1 - y2) + 1)
print(ans)

x1,y1=map(int,input().split())
x2,y2=map(int,input().split())
print(2*(max(abs(x1-x2)+1,2)+max(abs(y1-y2)+1,2)))

x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
print(2 * max(abs(x2 - x1), 1) + 2 * max(abs(y2 - y1), 1) + 4)




x,y=map(int,input().split())
x1,y1=map(int,input().split())
ans1=abs(x-x1)+1
ans2=abs(y-y1)+1
if x==x1 or y==y1:
    ans1+=1
print(ans1*2+ans2*2)

x,y = list(map(int,input().split()))
fx,fy = list(map(int,input().split()))
ans = 0 
if x == fx or y==fy :
	ans=2
ans +=  abs(fx-x)*2 + abs(fy-y)*2 + 4
print(ans)


a,b = map( int, input().split(' '))
c,d = map(int, input().split(' '))
j = 0
if c==a or b==d : j=2
print((abs(c-a)+1)*2 + 2*(abs(b-d)+1)+j)


n,k=map(int,input().strip().split(' '))
a,b=map(int,input().strip().split(' '))
print(2*(max(2,abs(a-n)+1)+max(2,abs(b-k)+1)))

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

if abs(a - c) == 0:
    print(2 * abs(b - d) + 6)
elif abs(b - d) == 0:
    print(2 * abs(a - c) + 6)
else:
    print(2 * abs(a - c) + 2 * abs(b-d) + 4)


x1,y1=[int(i) for i in input().split()]
x2,y2=[int(i) for i in input().split()]
if (x1==x2):
    print (4+2*(abs(y1-y2)+1))
elif (y1==y2):
    print (4+2*(abs(x1-x2)+1))
else:
    print (2*(abs(x1-x2)+1) + 2*(abs(y1-y2)+1))

x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))

dx = max(2, abs(x1-x2) + 1)
dy = max(2, abs(y1-y2) + 1)
print(dx*2 + dy*2)
    



xs, ys = list(map(int, input().split()))
xf, yf = list(map(int, input().split()))

if xs == xf:
    print((abs(yf - ys) + 1) * 2 + 4)
    return
elif ys == yf:
    print((abs(xf - xs) + 1) * 2 + 4)
    return

xs, xf = sorted([xs, xf])
ys, yf = sorted([ys, yf])

xf += 1
yf += 1

print(2 * (xf - xs) + 2 * (yf - ys))


x1,y1 = list(map(int,input().split()))
x2,y2 = list(map(int,input().split()))

if x1 == x2:
    print(4+2*(abs(y2-y1)+1))
elif y1==y2:
    print(4+2*(abs(x2-x1)+1))
else:
    print(2*(abs(x2-x1)+1)+2*(abs(y2-y1)+1))


a,b = map( int, input().split())
c,d = map(int, input().split())
k = 0
if c==a or b==d : k=2
print((abs(c-a)+1)*2 + 2*(abs(b-d)+1)+k)

# -*- coding: utf-8 -*-
"""
Created on Sat Oct 21 11:00:49 2017

@author: sven
"""
x1,y1=list(map(int,input().split()))
x2,y2=list(map(int,input().split()))

x=max(abs(x2-x1)+1,2)
y=max(abs(y2-y1)+1,2)
print((x+y)*2)


first = list(map(int, input().split()))
second = list(map(int, input().split()))

x_len = abs(first[0] - second[0]) 
y_len = abs(first[1] - second[1])
len_to_point = x_len + y_len
if len_to_point == 1:
  print(8)
else:
  if x_len == 0 or y_len == 0:
    print((len_to_point - 1) *2 + 8)
  else:
    print((len_to_point - 2) *2 + 8)

x1,y1 = map(int,input().split())
x2,y2 = map(int,input().split())
ans = 2 * ( abs(x1-x2) + abs(y1-y2)-1 ) + 6 
if x1 == x2 or y1 == y2:
    ans+=2
print(ans)

x_1, y_1 = input().split()
x_2,y_2 = input().split()
x_1 = int(x_1)
x_2 = int(x_2)
y_1 = int(y_1)
y_2 = int(y_2)

if x_1 == x_2:
    jwb = 2*(abs(y_2-y_1)+1) + 4

elif y_1 == y_2:
    jwb = 2*(abs(x_2-x_1)+1) + 4

else:
    jwb = 2*(abs(x_2-x_1)+1) + 2*(abs(y_2-y_1)+1)

print(jwb)


x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
x = 1 if not abs(x1-x2) else abs(x1-x2)
y = 1 if not abs(y1-y2) else abs(y1-y2)
print((x+1)*2 + (y+1)*2)


x1,y1=list(map(int,input().split()))
x2,y2=list(map(int,input().split()))

if x1==x2:
    print(4+(abs(y2-y1)+1)*2)
elif y1==y2:
    print((abs(x2-x1)+1)*2+4)
else:
    print((abs(x2-x1)+1)*2+(abs(y2-y1)+1)*2)


x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))

print(2 * (max(2, abs(x1 - x2) + 1) + max(2, abs(y1 - y2) + 1)))

def main():
	x1,y1 = map(int,input().split())
	x2,y2 = map(int,input().split())
	res = (abs(x2-x1) + abs(y2 - y1) +2)*2
	if x1==x2:
		res +=2
	if y1 == y2:
		res +=2
	print( res)

main()

#!/usr/bin/env python3

def main():
    x0, y0 = list(map(int, input().split()))
    x1, y1 = list(map(int, input().split()))
    print((max(abs(x1 - x0), 1) + max(abs(y1 - y0), 1)) * 2 + 4)

try:
    while True:
        main()
except EOFError:
    pass