Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/54a57cdcf7e3755ea687c12508bd83854e033ec3.png" style="max-width: 100.0%;max-height: 100.0%;"/>. Then he measured the length of its sides, and found that each of them is equal to an integer number of centimeters. There the properties of the hexagon ended and Gerald decided to draw on it.

He painted a few lines, parallel to the sides of the hexagon. The lines split the hexagon into regular triangles with sides of 1 centimeter. Now Gerald wonders how many triangles he has got. But there were so many of them that Gerald lost the track of his counting. Help the boy count the triangles.
The first and the single line of the input contains 6 space-separated integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, *a*<sub class="lower-index">3</sub>, *a*<sub class="lower-index">4</sub>, *a*<sub class="lower-index">5</sub> and *a*<sub class="lower-index">6</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 1000) — the lengths of the sides of the hexagons in centimeters in the clockwise order. It is guaranteed that the hexagon with the indicated properties and the exactly such sides exists.
from math import inf
from collections import *
import math, os, sys, heapq, bisect, random,threading
from functools import lru_cache
from itertools import *
def inp(): return sys.stdin.readline().rstrip("\r\n")
def out(var): sys.stdout.write(str(var))  # for fast output, always take string
def inpu(): return int(inp())
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
def fsep(): return map(float, inp().split())
M,M1=1000000007,998244353
def main():
    how_much_noob_I_am=1
    #how_much_noob_I_am=inpu()
    for _ in range(how_much_noob_I_am):
        l=lis()
        if len(set(l))==len(l):
            print(6)
            continue
        ans=0
        max1 = inf
        for i in range(len(l)-3):
            res = sum(l[i:i+3])
            if res<max1:
                ans2 = l[i:i+3]
                max1 = res
        a,b,c,d,e,f = l
        ans = (a+b+c)**2 - a**2 - c**2 - e**2
        print(ans)
if __name__ == '__main__':
    main()