Honeycomb

Problem Statement

A honeycomb is a six-sided shape composed of a tessellation of regular hexagons (cells) of the same size. The length of a side of the honeycomb is the number of hexagons that makes up that side.

Cece the Queen Bee has instructed her worker bees to construct a honeycomb similar to the one shown below, made up of regular hexagons called cells. Cece wants to assess the productivity of her workers and wants to know how many cells the honeycomb is made up of. She does this by flying around the perimeter of the honeycomb in a clockwise direction and counting the number of hexagons that make up each side.

Bees aren't very good at maths or programming because they are bees, so help Cece.

Input Format

The first and only line of input will contain the six integers A,B,C,D,EA, B, C, D, E and FF, the lengths of the sides in clockwise order.

Constraints

  • 2A,B,C,D,E,F50002 \leq A,B,C,D,E,F \leq 5000
  • You are guaranteed that the values of A,B,C,D,E,FA,B,C,D,E,F form a honeycomb with 6 sides (the resulting shape is well-formed and does not self-intersect).

Output Format

Output a single integer, the number of cells the honeycomb is made of.

Sample Input

6 6 7 3 9 4

Sample Input

81

Explanation

This sample input corresponds to the diagram. The honeycomb comprises 81 cells.

diagram