using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    static class Program
    {
        static void Main()
        {
            var args = ReadArgs();

            var w1 = args[0];
            var h1 = args[1];
            var w2 = args[2];
            var h2 = args[3];

            var ans1 = 2 * (h1 + 1) + w1;
            var ans2 = 2 * (h2 + 1) + w2;

            Console.WriteLine(ans1 + ans2 + Math.Abs(w1 - w2));
        }

        public static List<int> ReadArgs()
        {
            return Console.ReadLine().Split().Select(int.Parse).ToList();
        }

        public static int ReadValue()
        {
            return int.Parse(Console.ReadLine());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

          string[]y=Console.ReadLine().Split(' ');
          Int64 a=Int64.Parse(y[0]);
          Int64 b=Int64.Parse(y[1]);
          Int64 c=Int64.Parse(y[2]);
          Int64 d=Int64.Parse(y[3]);
          Console.WriteLine((b+d+2)*2+Math.Max(a,c)*2);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int w1, h1, w2, h2, result;
            string []s;

                s = Console.ReadLine().Split(' ');
                w1 = int.Parse(s[0]);
                h1 = int.Parse(s[1]);
                w2 = int.Parse(s[2]);
                h2 = int.Parse(s[3]);

            result = w1 + h1 + h2 + w2 + h2 + h1;

            if (w1 == w2)
                result += 4;
            else
                result += 5 + (w1 - w2 - 1);
            Console.WriteLine(result);

        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Sea_Battle
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            int w1 = Next(), h1 = Next(), w2 = Next(), h2 = Next();

            return w1 + 2 + h1*2 + w1 + 2 - w2 + (h2 - 1)*2 + w2 + 2;
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using Debug = System.Diagnostics.Debug;

class Ph
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(int.Parse).ToList();
        //- - - -
        //下の辺
        long res = 0;
        res += a[0] + 2;
        res += a[2] + 2;
        res += (a[1] + a[3]) * 2;
        res += Abs(a[0] - a[2]);
        Console.WriteLine(res);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SeaBattle
{
    class Program
    {
        public static int Width1;
        public static int Height1;
        public static int Width2;
        public static int Height2;
        public static string InputString = Console.ReadLine();
        static void Main()
        {
            ReadInput();
            Console.WriteLine(CalculateEasy() + CalculateLessEasy());

        }
        static void ReadInput()
        {
            int Length = InputString.Length;
            int NumberCurrent = 0;
            for (int i = 0; i < Length; i++)
            {
                if ("" + InputString[i] == " ")
                {
                    NumberCurrent++;
                }
                else
                {
                    switch (NumberCurrent)
                    {
                        case 0:
                            Width1 = int.Parse(Width1 + "" + InputString[i]);
                            break;
                        case 1:
                            Height1 = int.Parse(Height1 + "" + InputString[i]);
                            break;
                        case 2:
                            Width2 = int.Parse(Width2 + "" + InputString[i]);
                            break;
                        case 3:
                            Height2 = int.Parse(Height2 + "" + InputString[i]);
                            break;

                    }

                }
            }
        }
        static int CalculateEasy()
        {
            int numberOfSquares = 0;
            numberOfSquares = 2 * Height1 + Width1 + 2 + Height2 + Width2 + 2;
            return numberOfSquares;
        }
        static int CalculateLessEasy()
        {
            int numberOfSquares = 0;
            numberOfSquares = (Width1 - Width2 + Height2);
            return numberOfSquares;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Seabattle
{
    class Program
    {
        static void Main(string[] args)
        {
            /* 4 + h1 + h2 + w1 + w2 + h1 + h2 + abs(w1 - w2);
             w1,h1,w2,h2
            */
            int[] array1D = new int[9];
            array1D = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

            int h1 = array1D[1];
            int h2 = array1D[3];
            int w1 = array1D[0];
            int w2 = array1D[2];

            Console.WriteLine(4+h1+h2+w1+w2+h1+h2+Math.Abs(w1-w2));
           // Console.ReadLine();
        }
    }
}

/*
csc -debug A.cs && mono --debug A.exe <<< "2 1 2 1"
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class HelloWorld {
    public static void SolveCodeForces() {
        var w1 = cin.NextLong();
        var h1 = cin.NextLong();
        var w2 = cin.NextLong();
        var h2 = cin.NextLong();

        System.Console.WriteLine(
            w2 + 2 +
            2 * h2 - 2 +
            (w1 == w2 ? 4 : (4 + w1 - w2)) +
            2 * h1 - 2 +
            w1 + 2
        );
    }

    static Scanner cin = new Scanner();
    static StringBuilder cout = new StringBuilder();

    static public void Main () {
        SolveCodeForces();
        // System.Console.Write(cout.ToString());
    }
}

public static class Helpers {
    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }

    public static IEnumerable<int> IndicesWhere<T>(this IEnumerable<T> seq, Func<T, bool> cond) {
        var i = 0;
        foreach (var item in seq) {
            if (cond(item)) yield return i;
            i++;
        }
    }
}

public class Scanner
{
    private string[] line = new string[0];
    private int index = 0;

    public string Next() {
        if (line.Length <= index) {
            line = Console.ReadLine().Split(' ');
            index = 0;
        }
        var res = line[index];
        index++;
        return res;
    }

    public int NextInt() {
        return int.Parse(Next());
    }

    public long NextLong() {
        return long.Parse(Next());
    }

    public ulong NextUlong() {
        return ulong.Parse(Next());
    }

    public string[] Array() {
        line = Console.ReadLine().Split(' ');
        index = line.Length;
        return line;
    }

    public int[] IntArray(int emptyPrefixLen = 0) {
        var array = Array();
        var result = new int[emptyPrefixLen + array.Length];
        for (int i = 0; i < array.Length; i++)
            result[emptyPrefixLen + i] = int.Parse(array[i]);
        return result;
    }

    public long[] LongArray() {
        var array = Array();
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = long.Parse(array[i]);
        return result;
    }

    public ulong[] UlongArray() {
        var array = Array();
        var result = new ulong[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = ulong.Parse(array[i]);
        return result;
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = ReadArrayInt();
            var w1 = input[0];
            var h1 = input[1];
            var w2 = input[2];
            var h2 = input[3];
            var ans = 0L;
            ans += w1 + 2 + h1 * 2 + w2 + 2 + h2 * 2;
            if (w1 != w2) ans += w1 - w2;

            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

using System;
using System.Collections.Generic;

namespace Console_c
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            string[] inter= str.Split(' ');
            int[] inte = new int[4];
            inte[0] = Convert.ToInt32(inter[0]);
            inte[1] = Convert.ToInt32(inter[1]);
            inte[2] = Convert.ToInt32(inter[2]);
            inte[3] = Convert.ToInt32(inter[3]);
            int S =0;
            if (inte[0] == inte[2]) {
                int S1 = (inte[0]+2)*(inte[1]+inte[3]+2)-inte[0]*(inte[1]+inte[3]);
                Console.WriteLine(""+S1);
            } else if (inte[0] > inte[2]) {
                int S1 = (inte[2] + 2) * (inte[1] + inte[3] + 2) - inte[2] * (inte[1] + inte[3]);
                S1 = S1 + (inte[0] - inte[2])*2;
                Console.WriteLine("" + S1);
            }
        }
    }
}

using System;
class Codeforces_541_A
{
  static void Main()
  {
    string [] s = Console.ReadLine().Split(' ');
    int w1 = int.Parse(s[0]);
    int h1 = int.Parse(s[1]);
    int w2 = int.Parse(s[2]);
    int h2 = int.Parse(s[3]);
    int kl = (h1+h2)*2 + (w1+w2) + 4 + (w1-w2);
    Console.Write(kl);
  }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string[] token = Console.ReadLine().Split();

            int w1 = int.Parse(token[0]);
            int h1 = int.Parse(token[1]);

            int w2 = int.Parse(token[2]);
            int h2 = int.Parse(token[3]);

            int HH = h1 + h2;

            int WW = Math.Max(w1,w2);

            int ans  = 2 * (HH+WW) + 4;

            Console.WriteLine(ans);
        }
    }
}

using System;
using System.Linq;

namespace csharp
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            // ReSharper disable once PossibleNullReferenceException
            var inputs = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
            Console.WriteLine(inputs[0] + inputs[1] * 2 + inputs[2] + inputs[3] * 2 + inputs[0] - inputs[2] - 1 + 5);
        }
    }
}

/* Date: 25.02.2019 * Time: 21:45 */
//

/*
�	fflush(stdout) � ����� C++;
�	System.out.flush() � Java;
�	stdout.flush() � Python;
�	flush(output) � Pascal;

*/

using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

class Example
{
	public static void Swap (ref int a, ref int b)
	{
		int c = a; a = b; b = c;
	}
	public static void Main (string[] args)
	{
# if ( ! ONLINE_JUDGE )
		StreamReader sr = new StreamReader ("C:\\TRR\\2019\\Task\\07 Codeforces\\037\\A.TXT");
		StreamWriter sw = new StreamWriter ("C:\\TRR\\2019\\Task\\07 Codeforces\\037\\A.OUT");
# endif

		NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;

		int h1, w1, h2, w2;
		string s;

# if ( ONLINE_JUDGE )
		s = Console.ReadLine ();
# else
		s = sr.ReadLine ();
		sw.WriteLine ("*** a = " + s);
# endif

		{
			string [] ss = s.Split (' ');
			h1 = int.Parse (ss [1]);
			w1 = int.Parse (ss [0]);
			h2 = int.Parse (ss [3]);
			w2 = int.Parse (ss [2]);
		}

# if ( ! ONLINE_JUDGE )
		sw.WriteLine ("*** 1 = " + w1 + " " + h1);
		sw.WriteLine ("*** 2 = " + w2 + " " + h2);
# endif

		int m = 2*(h1 + w1 + h2 + 2);
		if ( w1 > w2 )
			m = 2*(h1 + w1 + h2 + 2);
		else if ( w1 < w2 )
			m = 2*(h1 + w2 + h2 + 2);

# if ( ONLINE_JUDGE )
		Console.WriteLine (m);
# else
		sw.WriteLine (m);
		sw.Close ();
# endif

	}
}

using System;
using System.Collections.Generic;

public class Test
{

    private static int ReadInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }

    private static long ReadLong()
    {
        return Convert.ToInt64(Console.ReadLine());
    }

    private static int[] ReadArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt32(m));
    }
    public static void Main()
    {
       int[] A = ReadArray();

        int w1 = A[0], h1 = A[1], w2 = A[2], h2 = A[3];

        Console.WriteLine((w1 + h1) * 2 + 4 + (h2 * 2));
    }
    }

using System;

namespace CodeForces_1131A
{
    class Program
    {
        static void Main(string[] args)
        {
            int w1, w2, h1, h2,h,w;
            var s = Console.ReadLine().Split(' ');
            w1 = Convert.ToInt32(s[0]);
            h1 = Convert.ToInt32(s[1]);
            w2 = Convert.ToInt32(s[2]);
            h2 = Convert.ToInt32(s[3]);
            w = w1;
            h = h1 + h2;

            int result = (h + 1) * 2 + (w + 1) * 2;
            Console.WriteLine(result);

        }
    }
}

namespace Problem
{
    using System;
    using System.Collections.Generic;
    class Problem1
    {
        static void Main()
        {
            string[] str = Console.ReadLine().Split();
            int w1 = int.Parse( str[0] );
            int h1 = int.Parse( str[1] );
            int w2 = int.Parse( str[2] );
            int h2 = int.Parse( str[3] );
            long kq = 0;
            kq = (long)( h1 + h2 + 2 ) * ( w1 + 2 ) - (long)( h1 + h2 ) * w1;
            Console.WriteLine( kq );

        }
    }
}

// Problem: 1131A - Sea Battle
// Author: Gusztav Szmolik

using System;

class SeaBattle
    {
    public static int Main ()
        {
        string line;
        string[] words;
        uint w1;
        uint h1;
        uint w2;
        uint h2;
        uint ans;

        line = Console.ReadLine ();
        if (line == null)
            return -1;
        words = line.Split ();
        if (words.Length != 4)
            return -1;
        if (!UInt32.TryParse (words[0], out w1))
            return -1;
        if (w1 < 1 || w1 > 100000000)
            return -1;
        if (!UInt32.TryParse (words[1], out h1))
            return -1;
        if (h1 < 1 || h1 > 100000000)
            return -1;
        if (!UInt32.TryParse (words[2], out w2))
            return -1;
        if (w2 < 1 || w2 > 100000000 || w1 < w2)
            return -1;
        if (!UInt32.TryParse (words[3], out h2))
            return -1;
        if (h2 < 1 || h2 > 100000000)
            return -1;
        ans = 2*(w1+h1+h2+2);
        Console.WriteLine (ans);
        return 0;
        }
    }

using System;
class Program
{
    static void Main()
    {
        int[] args = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        Console.WriteLine(2 * (args[0] + args[1] + args[3]) + 4);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using SB = System.Text.StringBuilder;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
using System.Numerics;
using static System.Math;
using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    readonly Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    readonly int dom = 998244353;
    bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }

    void solve()
    {
        var w1 = cin.nextlong;
        var h1 = cin.nextlong;
        var w2 = cin.nextlong;
        var h2 = cin.nextlong;

        long ans = 0;
        ans += h1 + h2 + 2;
        ans += w1 + 1;
        ans += h1;
        ans += w2 + 1;
        ans += h2;
        ans += w1 - w2;
        WriteLine(ans);
    }

}

static class Ex
{
    public static void join<T>(this IEnumerable<T> values, string sep = " ") => WriteLine(string.Join(sep, values));
    public static string concat<T>(this IEnumerable<T> values) => string.Concat(values);
    public static string reverse(this string s) { var t = s.ToCharArray(); Array.Reverse(t); return t.concat(); }

    public static int lower_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) < 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
    public static int upper_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) <= 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
}

class Pair<T, U> : IComparable<Pair<T, U>> where T : IComparable<T> where U : IComparable<U>
{
    public T f; public U s;
    public Pair(T f, U s) { this.f = f; this.s = s; }
    public int CompareTo(Pair<T, U> a) => f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);
    public override string ToString() => $"{f} {s}";
}

class Scanner
{
    string[] s; int i;
    readonly char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan => ReadLine().Split();
    public int[] scanint => Array.ConvertAll(scan, int.Parse);
    public long[] scanlong => Array.ConvertAll(scan, long.Parse);
    public double[] scandouble => Array.ConvertAll(scan, double.Parse);
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint => int.Parse(next);
    public long nextlong => long.Parse(next);
    public double nextdouble => double.Parse(next);
}

using System;

namespace CS_CodeForces
{
    internal class Program
    {
        private static void Main()
        {
            string[] inp = Console.ReadLine().Split(' ');
            int sum = 2 * (int.Parse(inp[0]) + int.Parse(inp[1]) + int.Parse(inp[3])) + 4;
            Console.Write(sum);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

namespace CodeForces
{
	class Program
	{
		static void Main(string[] args)
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(), Int64.Parse);
			var w1 = arr[0];
			var h1 = arr[1];
			var w2 = arr[2];
			var h2 = arr[3];
			var ans = (h1 + h2) * 2 + w1 * 2 + 4;
			Console.WriteLine(ans);
		}

		static int Int()
		{
			return Int32.Parse(Console.ReadLine());
		}

		static (int, int) Int2()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(), Int32.Parse);
			return (arr[0], arr[1]);
		}

		static int[] Ints()
		{
			return Array.ConvertAll(Console.ReadLine().Split(), Int32.Parse);
		}

		static long Long()
		{
			return Int64.Parse(Console.ReadLine());
		}

		static (long, long) Long2()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(), Int64.Parse);
			return (arr[0], arr[1]);
		}

		static long[] Longs()
		{
			return Array.ConvertAll(Console.ReadLine().Split(), Int64.Parse);
		}

		static string Str()
		{
			return Console.ReadLine();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace codeforces
{

    class Program
    {

        static void Main(string[] args)
        {
            int count=0;
            string[] prob = { " " };
            string  r=Console .ReadLine() ;
            string[] a =  r.Split (prob,StringSplitOptions .RemoveEmptyEntries );
            double  y = 2 *( int.Parse (a[0]) + int.Parse (a[1]) + int.Parse (a[3])) + 4;
            Console.WriteLine((y) );

        }
    }
}

using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] a = Console.ReadLine().Split().Select(double.Parse).ToArray();
            Console.WriteLine(a[0]+2 + a[2]+2 + a[1] * 2 + a[3] * 2 + (a[0] - a[2]));
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
             string[] sizes = Console.ReadLine().Split(' ');

             int w1 = Convert.ToInt32(sizes[0]);
             int h1 = Convert.ToInt32(sizes[1]);
             int w2 = Convert.ToInt32(sizes[2]);
             int h2 = Convert.ToInt32(sizes[3]);

            int cmnWidth = w1;
            int cmnHeight = h1 + h2;
            int w2Diff = w1 - w2;

            int markedTotal = w1 + 1 + cmnHeight + 1 + w2 + 1 + h2 + w2Diff + h1 + 1;

            Console.WriteLine(markedTotal);

        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using System.Numerics;
using static System.Math;
using Number = System.Int64;
using N = System.Int64;
using C = System.Int32;
namespace Program {
	public class Solver {
		Random rnd = new Random();
		public void Solve() {
			var a = Enumerate(4, x => rl);
			var ans = 0L;
			ans += 2 * (a[0] + a[1] + a[2] + a[3] + 2);
			ans -= 2 * a[2];
			Console.WriteLine(ans);

		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		int ri { get { return sc.Integer(); } }
		long rl { get { return sc.Long(); } }
		double rd { get { return sc.Double(); } }
		string rs { get { return sc.Scan(); } }
		public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());

		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n];
			for (int i = 0; i < a.Length; ++i) a[i] = f(i);
			return a;
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}
	static public void Main() {
		//Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		solver.Solve();
		Console.Out.Flush();
	}
}
#endregion
#region Ex
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}

	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}
}

#endregion

using System;

namespace CSharp
{
    class _1131A
    {
        public static void Main()
        {
            var tokens = Console.ReadLine().Split();

            int w1 = int.Parse(tokens[0]);
            int h1 = int.Parse(tokens[1]);

            int w2 = int.Parse(tokens[2]);
            int h2 = int.Parse(tokens[3]);

            Console.WriteLine(2 * (w1 + h1 + h2) + 4);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp131
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int w1 = int.Parse(s.Split(' ')[0]), h1 = int.Parse(s.Split(' ')[1]), w2 = int.Parse(s.Split(' ')[2]), h2 = int.Parse(s.Split(' ')[3]), res = (h1*2+w1*2+4) + (h2*2+w2*2+4) - (w2+2)*2;
            Console.WriteLine(res);
        }
    }
}

using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		int w1 = int.Parse(str[0]);
		int h1 = int.Parse(str[1]);
		int w2 = int.Parse(str[2]);
		int h2 = int.Parse(str[3]);
		int ans = 0;
		ans += w2+2;
		ans += h2*2;
		ans += h1*2;
		if(w2!=w1){
			ans += Math.Abs(w2-w1);
		}
		ans += w1+2;
		Console.WriteLine(ans);
	}
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    static class Program
    {
        static void Main()
        {
            var args = Reader.ReadIntArgs();
//
            var w1 = args[0];
            var h1 = args[1];
            var w2 = args[2];
            var h2 = args[3];

            var maxW = Math.Max(w1, w2);
            var maxH = Math.Max(h1, h2);

            Console.WriteLine((maxW + 2) * (maxH * 2 + 2) - (w1 * h1) - (w2 * h2) - Math.Abs(w1 * h1 - maxH * maxW) - Math.Abs(w2 * h2 - maxH * maxW));
        }
    }

    static class Reader
    {
        public static List<int> ReadIntArgs()
        {
            return ReadArgs(int.Parse);
        }

        public static List<long> ReadLongArgs()
        {
            return ReadArgs(long.Parse);
        }

        private static List<T> ReadArgs<T>(Func<string, T> parser)
        {
            return Console.ReadLine().Split().Select(parser).ToList();
        }

        public static int ReadIntValue()
        {
            return ReadValue(int.Parse);
        }

        public static long ReadLongValue()
        {
            return ReadValue(long.Parse);
        }

        private static T ReadValue<T>(Func<string, T> parser)
        {
            return parser(Console.ReadLine());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    static class Program
    {
        static void Main()
        {
            var args = Reader.ReadIntArgs();

            var w1 = args[0];
            var h1 = args[1];
            var w2 = args[2];
            var h2 = args[3];

            var maxW = Math.Max(w1, w2);
            var maxH = Math.Max(h1, h2);

            Console.WriteLine((maxW + 2) * (maxH * 2 + 2) - (w1 * h1) - (w2 * h2) - Math.Abs(w1 * h1 - maxH * maxW) - Math.Abs(w2 * h2 - maxH * maxW));
        }
    }

    static class Reader
    {
        public static List<int> ReadIntArgs()
        {
            return ReadArgs(int.Parse);
        }

        public static List<long> ReadLongArgs()
        {
            return ReadArgs(long.Parse);
        }

        private static List<T> ReadArgs<T>(Func<string, T> parser)
        {
            return Console.ReadLine().Split().Select(parser).ToList();
        }

        public static int ReadIntValue()
        {
            return ReadValue(int.Parse);
        }

        public static long ReadLongValue()
        {
            return ReadValue(long.Parse);
        }

        private static T ReadValue<T>(Func<string, T> parser)
        {
            return parser(Console.ReadLine());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int w1, h1, w2, h2, result;
            string []s;

                s = Console.ReadLine().Split(' ');
                w1 = int.Parse(s[0]);
                h1 = int.Parse(s[1]);
                w2 = int.Parse(s[2]);
                h2 = int.Parse(s[3]);

            result = w1 + h1 + h2 + w2 + h2 + h1+(w1-w2);

            if (w1 == w2)
                result += 4;
            else
                result += 5;
            Console.WriteLine(result);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int w1, h1, w2, h2, result;
            string []s;

                s = Console.ReadLine().Split(' ');
                w1 = int.Parse(s[0]);
                h1 = int.Parse(s[1]);
                w2 = int.Parse(s[2]);
                h2 = int.Parse(s[3]);

            result = w1 + h1 + h2 + w2 + h2 + h2;

            if (w1 == w2)
                result += 4;
            else
                result += 5;
            Console.WriteLine(result);

        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using Debug = System.Diagnostics.Debug;

class P
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(int.Parse).ToList();
        //- - - -
        //下の辺
        long res = 0;
        res += a[0] + 2;
        res += a[2] + 2;
        res += (a[1] + a[3]) * 2;
        res += Abs(a[1] - a[3]);
        Console.WriteLine(res);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = ReadArrayInt();
            var w1 = input[0];
            var h1 = input[1];
            var w2 = input[2];
            var h2 = input[3];
            var ans = 0L;
            ans += w1 + 2 + h1 * 2 + w2 + 2 + h2 * 2;
            if (w1 != w2) ans++;

            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

/* Date: 25.02.2019 * Time: 21:45 */
//

/*
�	fflush(stdout) � ����� C++;
�	System.out.flush() � Java;
�	stdout.flush() � Python;
�	flush(output) � Pascal;

*/

using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

class Example
{
	public static void Swap (ref int a, ref int b)
	{
		int c = a; a = b; b = c;
	}
	public static void Main (string[] args)
	{
# if ( ! ONLINE_JUDGE )
		StreamReader sr = new StreamReader ("C:\\TRR\\2019\\Task\\07 Codeforces\\037\\A.TXT");
		StreamWriter sw = new StreamWriter ("C:\\TRR\\2019\\Task\\07 Codeforces\\037\\A.OUT");
# endif

		NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;

		int h1, w1, h2, w2;
		string s;

# if ( ONLINE_JUDGE )
		s = Console.ReadLine ();
# else
		s = sr.ReadLine ();
		sw.WriteLine ("*** a = " + s);
# endif

		{
			string [] ss = s.Split (' ');
			h1 = int.Parse (ss [1]);
			w1 = int.Parse (ss [0]);
			h2 = int.Parse (ss [3]);
			w2 = int.Parse (ss [2]);
		}

# if ( ! ONLINE_JUDGE )
		sw.WriteLine ("*** 1 = " + w1 + " " + h1);
		sw.WriteLine ("*** 2 = " + w2 + " " + h2);
# endif

		int m = 2*(h1 + w1 + h2 + 2) + w2;
		if ( w1 != w2 )
			m += (w2 - w1)*2 - 1;

		if ( w1 == w2 )
			m -= w1;
		else
			m++;

# if ( ONLINE_JUDGE )
		Console.WriteLine (m);
# else
		sw.WriteLine (m);
		sw.Close ();
# endif

	}
}

namespace Problem
{
    using System;
    using System.Collections.Generic;
    class Problem1
    {
        static void Main()
        {
            string[] str = Console.ReadLine().Split();
            int w1 = int.Parse( str[0] );
            int h1 = int.Parse( str[1] );
            int w2 = int.Parse( str[2] );
            int h2 = int.Parse( str[3] );
            long kq = 0;
            kq = (long)( h1 + h2 + 2 ) * ( w1 + 2 ) - ( h1 + h2 ) * w1;
            Console.WriteLine( kq );

        }
    }
}

using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		int w1 = int.Parse(str[0]);
		int h1 = int.Parse(str[1]);
		int w2 = int.Parse(str[2]);
		int h2 = int.Parse(str[3]);
		int ans = 0;
		ans += w2+2;
		ans += h2*2;
		ans += h1*2;
		if(w2!=w1){
			ans += 1;
		}
		ans += w1+2;
		Console.WriteLine(ans);
	}
}

using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		int w1 = int.Parse(str[0]);
		int h1 = int.Parse(str[1]);
		int w2 = int.Parse(str[2]);
		int h2 = int.Parse(str[3]);
		int ans = 0;
		ans += w2+2;
		ans += h2*2;
		ans += h1*2;
		if(w2!=w1){
			ans += 1;
		}
		ans += w1*2;
		Console.WriteLine(ans);
	}
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    static class Program
    {
        static void Main()
        {
            var args = ReadArgs();

            var w1 = args[0];
            var h1 = args[1];
            var w2 = args[2];
            var h2 = args[3];

            var ans1 = 2 * (h1 + 1) + w1;
            var ans2 = 2 * (h2 + 1) + w2;

            Console.WriteLine(ans1 + ans2 + Math.Abs(ans1 - ans2));
        }

        public static List<int> ReadArgs()
        {
            return Console.ReadLine().Split().Select(int.Parse).ToList();
        }

        public static int ReadValue()
        {
            return int.Parse(Console.ReadLine());
        }
    }
}