Problem: Vasya plays the Power Defence. 

He must pass the last level of the game. In order to do this he must kill the Main Villain, who moves in a straight line at speed 1 meter per second from the point ( - ∞, 0) to the point ( + ∞, 0) of the game world. In the points (x, 1) and (x, - 1), where x is an integer number, Vasya can build towers of three types: fire-tower, electric-tower or freezing-tower. However, it is not allowed to build two towers at the same point. Towers of each type have a certain action radius and the value of damage per second (except freezing-tower). If at some point the Main Villain is in the range of action of k freezing towers then his speed is decreased by k + 1 times.

The allowed number of towers of each type is known. It is necessary to determine the maximum possible damage we can inflict on the Main Villain.

All distances in the problem are given in meters. The size of the Main Villain and the towers are so small, that they can be considered as points on the plane. The Main Villain is in the action radius of a tower if the distance between him and tower is less than or equal to the action radius of the tower.

Input

The first line contains three integer numbers nf, ne and ns — the maximum number of fire-towers, electric-towers and freezing-towers that can be built (0 ≤ nf, ne, ns ≤ 20, 1 ≤ nf + ne + ns ≤ 20). The numbers are separated with single spaces.

The second line contains three integer numbers rf, re and rs (1 ≤ rf, re, rs ≤ 1000) — the action radii of fire-towers, electric-towers and freezing-towers. The numbers are separated with single spaces.

The third line contains two integer numbers df and de (1 ≤ df, de ≤ 1000) — the damage a fire-tower and an electronic-tower can inflict on the Main Villain per second (in the case when the Main Villain is in the action radius of the tower). The numbers are separated with single space.

Output

Print the only real number — the maximum possible damage to the Main Villain with absolute or relative error not more than 10 - 6.

Examples

Input

1 0 0
10 10 10
100 100


Output

1989.97487421

Input

1 0 1
10 10 10
100 100


Output

3979.94974843

Note

In the first sample we've got one fire-tower that always inflicts the same damage, independently of its position. 

In the second sample we've got another freezing-tower of the same action radius. If we build the two towers opposite each other, then the Main Villain's speed will be two times lower, whenever he enters the fire-tower's action radius. That means that the enemy will be inflicted with twice more damage.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int nf, ne, nz, rf, re, rz, df, de;
double f, e, z, ans, d[30][30];
int a[100], N;
vector<pair<double, double> > ve;
void dp() {
  int i, j, k;
  ve.clear();
  ve.push_back(make_pair(-1e8, 1e8));
  for (i = 0; i <= N; i++) {
    for (j = 0; j < a[i]; j++) {
      ve.push_back(make_pair(i - z, i + z));
    }
  }
  memset(d, 0, sizeof(d));
  d[0][0] = 0;
  double fire, elec, l, r;
  for (i = 0; i <= N; i++) {
    for (j = 0; j < 2 - a[i]; j++) {
      fire = 0;
      elec = 0;
      for (k = 0; k < ve.size(); k++) {
        l = max(ve[k].first, i - f);
        r = min(ve[k].second, i + f);
        if (r > l) {
          fire += (r - l);
        }
        l = max(ve[k].first, i - e);
        r = min(ve[k].second, i + e);
        if (r > l) {
          elec += (r - l);
        }
      }
      fire *= df;
      elec *= de;
      for (int ii = nf; ii >= 0; ii--) {
        for (int jj = ne; jj >= 0; jj--) {
          if (ii > 0) {
            d[ii][jj] = max(d[ii][jj], d[ii - 1][jj] + fire);
          }
          if (jj > 0) {
            d[ii][jj] = max(d[ii][jj], d[ii][jj - 1] + elec);
          }
        }
      }
    }
  }
  ans = max(ans, d[nf][ne]);
}
void go() {
  vector<pair<double, double> > vec;
  vec.push_back(make_pair(-1e7, 1e7));
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < a[i]; ++j) {
      vec.push_back(make_pair(i - z, i + z));
    }
  }
  for (int i = 0; i <= nf; ++i) {
    for (int j = 0; j <= ne; ++j) {
      d[i][j] = -1;
    }
  }
  d[0][0] = 0;
  for (int i = 0; i < N; ++i) {
    for (int k = 0; k < 2 - a[i]; ++k) {
      double v0 = 0;
      double v1 = 0;
      for (__typeof(vec.begin()) it = vec.begin(); it != vec.end(); it++) {
        {
          double l = max(i - f, it->first);
          double r = min(i + f, it->second);
          if (r > l) {
            v0 += r - l;
          }
        }
        {
          double l = max(i - e, it->first);
          double r = min(i + e, it->second);
          if (r > l) {
            v1 += r - l;
          }
        }
      }
      v0 *= df;
      v1 *= de;
      for (int c0 = nf; c0 >= 0; --c0) {
        for (int c1 = ne; c1 >= 0; --c1) {
          if (c0 > 0 && d[c0 - 1][c1] > -0.5) {
            d[c0][c1] = max(d[c0][c1], d[c0 - 1][c1] + v0);
          }
          if (c1 > 0 && d[c0][c1 - 1] > -0.5) {
            d[c0][c1] = max(d[c0][c1], d[c0][c1 - 1] + v1);
          }
        }
      }
    }
  }
  ans = max(ans, d[nf][ne]);
}
int dfs(int pos, int x) {
  if (pos == N) {
    if (x == 0) {
      dp();
    }
    return 0;
  }
  if (x < 0) {
    return 0;
  }
  a[pos] = 0;
  dfs(pos + 1, x);
  a[pos] = 1;
  dfs(pos + 1, x - 1);
  a[pos] = 2;
  dfs(pos + 1, x - 2);
  return 0;
}
int main() {
  int i, j, k, n, m;
  scanf("%d%d%d", &nf, &ne, &nz);
  scanf("%d%d%d", &rf, &re, &rz);
  scanf("%d%d", &df, &de);
  memset(a, 0, sizeof(a));
  ans = 0;
  f = sqrt(rf * rf - 1);
  e = sqrt(re * re - 1);
  z = sqrt(rz * rz - 1);
  N = (nf + ne + nz + 1) / 2;
  dfs(0, nz);
  printf("%.10lf", ans);
  return 0;
}