#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
  fast_ios() {
    cin.tie(nullptr), ios::sync_with_stdio(false),
        cout << fixed << setprecision(20);
  };
} fast_ios_;
template <typename T, typename V>
void ndarray(vector<T> &vec, const V &val, int len) {
  vec.assign(len, val);
}
template <typename T, typename V, typename... Args>
void ndarray(vector<T> &vec, const V &val, int len, Args... args) {
  vec.resize(len),
      for_each(begin(vec), end(vec), [&](T &v) { ndarray(v, val, args...); });
}
template <typename T>
bool chmax(T &m, const T q) {
  if (m < q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T>
bool chmin(T &m, const T q) {
  if (m > q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T1, typename T2>
pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) {
  return make_pair(l.first + r.first, l.second + r.second);
}
template <typename T1, typename T2>
pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) {
  return make_pair(l.first - r.first, l.second - r.second);
}
template <typename T>
vector<T> srtunq(vector<T> vec) {
  sort(vec.begin(), vec.end()),
      vec.erase(unique(vec.begin(), vec.end()), vec.end());
  return vec;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << '[';
  for (auto v : vec) os << v << ',';
  os << ']';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const deque<T> &vec) {
  os << "deq[";
  for (auto v : vec) os << v << ',';
  os << ']';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T, typename TH>
ostream &operator<<(ostream &os, const unordered_set<T, TH> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_multiset<T> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &pa) {
  os << '(' << pa.first << ',' << pa.second << ')';
  return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const map<TK, TV> &mp) {
  os << '{';
  for (auto v : mp) os << v.first << "=>" << v.second << ',';
  os << '}';
  return os;
}
template <typename TK, typename TV, typename TH>
ostream &operator<<(ostream &os, const unordered_map<TK, TV, TH> &mp) {
  os << '{';
  for (auto v : mp) os << v.first << "=>" << v.second << ',';
  os << '}';
  return os;
}
template <typename T_P>
struct P {
  static T_P EPS;
  static void set_eps(T_P e) { EPS = e; }
  T_P x, y;
  P() : x(0), y(0) {}
  P(T_P x, T_P y) : x(x), y(y) {}
  P(std::pair<T_P, T_P> p) : x(p.first), y(p.second) {}
  static T_P add_w_error(T_P a, T_P b) noexcept {
    return (std::abs(a + b) < P::EPS * (std::abs(a) + std::abs(b))) ? 0 : a + b;
  }
  P operator+(const P &p) const noexcept {
    return P(add_w_error(x, p.x), add_w_error(y, p.y));
  }
  P operator-(const P &p) const noexcept {
    return P(add_w_error(x, -p.x), add_w_error(y, -p.y));
  }
  P operator*(const P &p) const noexcept {
    return P(add_w_error(x * p.x, -y * p.y), add_w_error(x * p.y, y * p.x));
  }
  P operator*(T_P d) const noexcept { return P(x * d, y * d); }
  P operator/(T_P d) const noexcept { return P(x / d, y / d); }
  P inv() const { return conj() / norm2(); }
  P operator/(const P &p) const { return (*this) * p.inv(); }
  bool operator<(const P &r) const noexcept {
    return x != r.x ? x < r.x : y < r.y;
  }
  bool operator==(const P &r) const noexcept {
    return add_w_error(x, -r.x) == 0 and add_w_error(y, -r.y) == 0;
  }
  bool operator!=(const P &r) const noexcept { return !((*this) == r); }
  T_P dot(P p) const noexcept { return add_w_error(x * p.x, y * p.y); }
  T_P det(P p) const noexcept { return add_w_error(x * p.y, -y * p.x); }
  T_P norm() const noexcept { return std::sqrt(x * x + y * y); }
  T_P norm2() const noexcept { return x * x + y * y; }
  T_P arg() const noexcept { return std::atan2(y, x); }
  P rotate(T_P rad) noexcept {
    return P(add_w_error(x * std::cos(rad), -y * std::sin(rad)),
             add_w_error(x * std::sin(rad), y * std::cos(rad)));
  }
  P normalized() const { return (*this) / this->norm(); }
  P conj() const noexcept { return P(x, -y); }
  friend std::istream &operator>>(std::istream &is, P &p) {
    T_P x, y;
    is >> x >> y;
    p = P(x, y);
    return is;
  }
  friend std::ostream &operator<<(std::ostream &os, const P &p) {
    os << '(' << p.x << ',' << p.y << ')';
    return os;
  }
};
template <>
double P<double>::EPS = 1e-9;
template <>
long double P<long double>::EPS = 1e-12;
template <typename T_P>
int ccw(const P<T_P> &a, const P<T_P> &b, const P<T_P> &c) {
  P<T_P> v1 = b - a;
  P<T_P> v2 = c - a;
  if (v1.det(v2) > P<T_P>::EPS) return 1;
  if (v1.det(v2) < -P<T_P>::EPS) return -1;
  if (v1.dot(v2) < -P<T_P>::EPS) return 2;
  if (v1.norm() < v2.norm()) return -2;
  return 0;
}
template <typename T_P>
std::vector<int> convex_hull(const std::vector<P<T_P>> &ps,
                             bool include_boundary = false) {
  int n = ps.size();
  if (n <= 1) return std::vector<int>(n, 0);
  std::vector<std::pair<P<T_P>, int>> points(n);
  for (size_t i = 0; i < ps.size(); i++) points[i] = std::make_pair(ps[i], i);
  std::sort(points.begin(), points.end());
  int k = 0;
  std::vector<std::pair<P<T_P>, int>> qs(2 * n);
  auto ccw_check = [&](int c) {
    if (include_boundary)
      return c == -1;
    else
      return c <= 0;
  };
  for (int i = 0; i < n; i++) {
    while (k > 1 and
           ccw_check(ccw(qs[k - 2].first, qs[k - 1].first, points[i].first)))
      k--;
    qs[k++] = points[i];
  }
  for (int i = n - 2, t = k; i >= 0; i--) {
    while (k > t and
           ccw_check(ccw(qs[k - 2].first, qs[k - 1].first, points[i].first)))
      k--;
    qs[k++] = points[i];
  }
  std::vector<int> ret(k - 1);
  for (int i = 0; i < k - 1; i++) ret[i] = qs[i].second;
  return ret;
}
template <typename T_P>
P<T_P> circumcenter(const P<T_P> &z1, const P<T_P> &z2, const P<T_P> &z3) {
  assert(abs(ccw(z1, z2, z3)) % 2 == 1);
  P<T_P> a = z2 - z1, b = z3 - z1;
  return z1 + a * b * (a - b).conj() / (b * a.conj() - a * b.conj());
}
template <typename T_P>
std::vector<P<T_P>> IntersectTwoCircles(const P<T_P> &Ca, double Ra,
                                        const P<T_P> &Cb, double Rb) {
  double d = (Ca - Cb).norm();
  if (Ra + Rb < d) return {};
  double rc = (d * d + Ra * Ra - Rb * Rb) / (2 * d);
  double rs = sqrt(Ra * Ra - rc * rc);
  P<T_P> diff = (Cb - Ca) / d;
  return {Ca + diff * P<T_P>(rc, rs), Ca + diff * P<T_P>(rc, -rs)};
}
template <typename T_P>
std::vector<T_P> IntersectCircleLine(const P<T_P> &x0, const P<T_P> &v, T_P R) {
  T_P b = x0.dot(v) / v.norm2();
  T_P c = (x0.norm2() - R * R) / v.norm2();
  if (b * b - c < 0) return {};
  T_P ret1;
  if (b > 0)
    ret1 = -b - sqrt(b * b - c);
  else
    ret1 = -b + sqrt(b * b - c);
  T_P ret2 = c / ret1;
  std::vector<T_P> ret{ret1, ret2};
  std::sort(ret.begin(), ret.end());
  return ret;
}
template <typename T_P>
T_P DistancePointLine(const P<T_P> &p, const P<T_P> &a, const P<T_P> &b) {
  assert(a != b);
  return std::abs((b - a).det(p - a)) / (b - a).norm();
}
template <typename T_P>
T_P DistancePointSegment(const P<T_P> &p, const P<T_P> &a, const P<T_P> &b) {
  if (a == b)
    return (p - a).norm();
  else if ((p - a).dot(b - a) <= 0)
    return (p - a).norm();
  else if ((p - b).dot(a - b) <= 0)
    return (p - b).norm();
  else
    return DistancePointLine(p, a, b);
}
using Pt = P<double>;
double tri(Pt a, Pt b, Pt c) { return abs((a - b).det(c - b)) / 2; }
int main() {
  vector<double> V(6);
  double pi = acos(-1.0);
  cin >> V;
  Pt V1(0, 0);
  Pt V2 = V1 + Pt(V[0], 0);
  Pt V3 = V2 + Pt(V[1], 0).rotate(-pi / 3);
  Pt V4 = V3 + Pt(V[2], 0).rotate(-pi / 3 * 2);
  Pt V5 = V4 + Pt(V[3], 0).rotate(-pi / 3 * 3);
  Pt V6 = V5 + Pt(V[4], 0).rotate(-pi / 3 * 4);
  double area =
      tri(V1, V2, V3) + tri(V1, V3, V4) + tri(V1, V4, V5) + tri(V1, V5, V6);
  cout << llround(area / (sqrt(3) / 4)) << '\n';
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to <image>. 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.

Input

The first and the single line of the input contains 6 space-separated integers a1, a2, a3, a4, a5 and a6 (1 ≤ ai ≤ 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.

Output

Print a single integer — the number of triangles with the sides of one 1 centimeter, into which the hexagon is split.

Examples

Input

1 1 1 1 1 1


Output

6


Input

1 2 1 2 1 2


Output

13

Note

This is what Gerald's hexagon looks like in the first sample:

<image>

And that's what it looks like in the second sample:

<image>

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
  fast_ios() {
    cin.tie(nullptr), ios::sync_with_stdio(false),
        cout << fixed << setprecision(20);
  };
} fast_ios_;
template <typename T, typename V>
void ndarray(vector<T> &vec, const V &val, int len) {
  vec.assign(len, val);
}
template <typename T, typename V, typename... Args>
void ndarray(vector<T> &vec, const V &val, int len, Args... args) {
  vec.resize(len),
      for_each(begin(vec), end(vec), [&](T &v) { ndarray(v, val, args...); });
}
template <typename T>
bool chmax(T &m, const T q) {
  if (m < q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T>
bool chmin(T &m, const T q) {
  if (m > q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T1, typename T2>
pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) {
  return make_pair(l.first + r.first, l.second + r.second);
}
template <typename T1, typename T2>
pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) {
  return make_pair(l.first - r.first, l.second - r.second);
}
template <typename T>
vector<T> srtunq(vector<T> vec) {
  sort(vec.begin(), vec.end()),
      vec.erase(unique(vec.begin(), vec.end()), vec.end());
  return vec;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << '[';
  for (auto v : vec) os << v << ',';
  os << ']';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const deque<T> &vec) {
  os << "deq[";
  for (auto v : vec) os << v << ',';
  os << ']';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T, typename TH>
ostream &operator<<(ostream &os, const unordered_set<T, TH> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_multiset<T> &vec) {
  os << '{';
  for (auto v : vec) os << v << ',';
  os << '}';
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &pa) {
  os << '(' << pa.first << ',' << pa.second << ')';
  return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const map<TK, TV> &mp) {
  os << '{';
  for (auto v : mp) os << v.first << "=>" << v.second << ',';
  os << '}';
  return os;
}
template <typename TK, typename TV, typename TH>
ostream &operator<<(ostream &os, const unordered_map<TK, TV, TH> &mp) {
  os << '{';
  for (auto v : mp) os << v.first << "=>" << v.second << ',';
  os << '}';
  return os;
}
template <typename T_P>
struct P {
  static T_P EPS;
  static void set_eps(T_P e) { EPS = e; }
  T_P x, y;
  P() : x(0), y(0) {}
  P(T_P x, T_P y) : x(x), y(y) {}
  P(std::pair<T_P, T_P> p) : x(p.first), y(p.second) {}
  static T_P add_w_error(T_P a, T_P b) noexcept {
    return (std::abs(a + b) < P::EPS * (std::abs(a) + std::abs(b))) ? 0 : a + b;
  }
  P operator+(const P &p) const noexcept {
    return P(add_w_error(x, p.x), add_w_error(y, p.y));
  }
  P operator-(const P &p) const noexcept {
    return P(add_w_error(x, -p.x), add_w_error(y, -p.y));
  }
  P operator*(const P &p) const noexcept {
    return P(add_w_error(x * p.x, -y * p.y), add_w_error(x * p.y, y * p.x));
  }
  P operator*(T_P d) const noexcept { return P(x * d, y * d); }
  P operator/(T_P d) const noexcept { return P(x / d, y / d); }
  P inv() const { return conj() / norm2(); }
  P operator/(const P &p) const { return (*this) * p.inv(); }
  bool operator<(const P &r) const noexcept {
    return x != r.x ? x < r.x : y < r.y;
  }
  bool operator==(const P &r) const noexcept {
    return add_w_error(x, -r.x) == 0 and add_w_error(y, -r.y) == 0;
  }
  bool operator!=(const P &r) const noexcept { return !((*this) == r); }
  T_P dot(P p) const noexcept { return add_w_error(x * p.x, y * p.y); }
  T_P det(P p) const noexcept { return add_w_error(x * p.y, -y * p.x); }
  T_P norm() const noexcept { return std::sqrt(x * x + y * y); }
  T_P norm2() const noexcept { return x * x + y * y; }
  T_P arg() const noexcept { return std::atan2(y, x); }
  P rotate(T_P rad) noexcept {
    return P(add_w_error(x * std::cos(rad), -y * std::sin(rad)),
             add_w_error(x * std::sin(rad), y * std::cos(rad)));
  }
  P normalized() const { return (*this) / this->norm(); }
  P conj() const noexcept { return P(x, -y); }
  friend std::istream &operator>>(std::istream &is, P &p) {
    T_P x, y;
    is >> x >> y;
    p = P(x, y);
    return is;
  }
  friend std::ostream &operator<<(std::ostream &os, const P &p) {
    os << '(' << p.x << ',' << p.y << ')';
    return os;
  }
};
template <>
double P<double>::EPS = 1e-9;
template <>
long double P<long double>::EPS = 1e-12;
template <typename T_P>
int ccw(const P<T_P> &a, const P<T_P> &b, const P<T_P> &c) {
  P<T_P> v1 = b - a;
  P<T_P> v2 = c - a;
  if (v1.det(v2) > P<T_P>::EPS) return 1;
  if (v1.det(v2) < -P<T_P>::EPS) return -1;
  if (v1.dot(v2) < -P<T_P>::EPS) return 2;
  if (v1.norm() < v2.norm()) return -2;
  return 0;
}
template <typename T_P>
std::vector<int> convex_hull(const std::vector<P<T_P>> &ps,
                             bool include_boundary = false) {
  int n = ps.size();
  if (n <= 1) return std::vector<int>(n, 0);
  std::vector<std::pair<P<T_P>, int>> points(n);
  for (size_t i = 0; i < ps.size(); i++) points[i] = std::make_pair(ps[i], i);
  std::sort(points.begin(), points.end());
  int k = 0;
  std::vector<std::pair<P<T_P>, int>> qs(2 * n);
  auto ccw_check = [&](int c) {
    if (include_boundary)
      return c == -1;
    else
      return c <= 0;
  };
  for (int i = 0; i < n; i++) {
    while (k > 1 and
           ccw_check(ccw(qs[k - 2].first, qs[k - 1].first, points[i].first)))
      k--;
    qs[k++] = points[i];
  }
  for (int i = n - 2, t = k; i >= 0; i--) {
    while (k > t and
           ccw_check(ccw(qs[k - 2].first, qs[k - 1].first, points[i].first)))
      k--;
    qs[k++] = points[i];
  }
  std::vector<int> ret(k - 1);
  for (int i = 0; i < k - 1; i++) ret[i] = qs[i].second;
  return ret;
}
template <typename T_P>
P<T_P> circumcenter(const P<T_P> &z1, const P<T_P> &z2, const P<T_P> &z3) {
  assert(abs(ccw(z1, z2, z3)) % 2 == 1);
  P<T_P> a = z2 - z1, b = z3 - z1;
  return z1 + a * b * (a - b).conj() / (b * a.conj() - a * b.conj());
}
template <typename T_P>
std::vector<P<T_P>> IntersectTwoCircles(const P<T_P> &Ca, double Ra,
                                        const P<T_P> &Cb, double Rb) {
  double d = (Ca - Cb).norm();
  if (Ra + Rb < d) return {};
  double rc = (d * d + Ra * Ra - Rb * Rb) / (2 * d);
  double rs = sqrt(Ra * Ra - rc * rc);
  P<T_P> diff = (Cb - Ca) / d;
  return {Ca + diff * P<T_P>(rc, rs), Ca + diff * P<T_P>(rc, -rs)};
}
template <typename T_P>
std::vector<T_P> IntersectCircleLine(const P<T_P> &x0, const P<T_P> &v, T_P R) {
  T_P b = x0.dot(v) / v.norm2();
  T_P c = (x0.norm2() - R * R) / v.norm2();
  if (b * b - c < 0) return {};
  T_P ret1;
  if (b > 0)
    ret1 = -b - sqrt(b * b - c);
  else
    ret1 = -b + sqrt(b * b - c);
  T_P ret2 = c / ret1;
  std::vector<T_P> ret{ret1, ret2};
  std::sort(ret.begin(), ret.end());
  return ret;
}
template <typename T_P>
T_P DistancePointLine(const P<T_P> &p, const P<T_P> &a, const P<T_P> &b) {
  assert(a != b);
  return std::abs((b - a).det(p - a)) / (b - a).norm();
}
template <typename T_P>
T_P DistancePointSegment(const P<T_P> &p, const P<T_P> &a, const P<T_P> &b) {
  if (a == b)
    return (p - a).norm();
  else if ((p - a).dot(b - a) <= 0)
    return (p - a).norm();
  else if ((p - b).dot(a - b) <= 0)
    return (p - b).norm();
  else
    return DistancePointLine(p, a, b);
}
using Pt = P<double>;
double tri(Pt a, Pt b, Pt c) { return abs((a - b).det(c - b)) / 2; }
int main() {
  vector<double> V(6);
  double pi = acos(-1.0);
  cin >> V;
  Pt V1(0, 0);
  Pt V2 = V1 + Pt(V[0], 0);
  Pt V3 = V2 + Pt(V[1], 0).rotate(-pi / 3);
  Pt V4 = V3 + Pt(V[2], 0).rotate(-pi / 3 * 2);
  Pt V5 = V4 + Pt(V[3], 0).rotate(-pi / 3 * 3);
  Pt V6 = V5 + Pt(V[4], 0).rotate(-pi / 3 * 4);
  double area =
      tri(V1, V2, V3) + tri(V1, V3, V4) + tri(V1, V4, V5) + tri(V1, V5, V6);
  cout << llround(area / (sqrt(3) / 4)) << '\n';
}

```