#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N=14;
const double INF=1e11;
int A,B,C,D;
double f[N][N][N][N][5][5];
double dp(int a,int b,int c,int d,int x,int y) // 求解 f[a][b][c][d][x][y]
{
double &v = f[a][b][c][d][x][y];
if(v >= 0) return v;
int as = a + (x == 0) + (y == 0);
int bs = b + (x == 1) + (y == 1);
int cs = c + (x == 2) + (y == 2);
int ds = d + (x == 3) + (y == 3);
if(as >= A && bs >= B && cs >= C && ds >= D) return v = 0; // 说明此状态为终点,按定义来 f = 0 !!!
int sum = as + bs + cs + ds;
if(sum >= 54) return v = INF;
sum = 54 - sum;
v = 0; // v = 0 或 v = 1 都是可以的,只是含义和下面的计算过程不同,自己明白即可 !
if(a < 13) v += (13.0 - a) / sum * (dp(a + 1,b,c,d,x,y) + 1);
if(b < 13) v += (13.0 - b) / sum * (dp(a,b + 1,c,d,x,y) + 1);
if(c < 13) v += (13.0 - c) / sum * (dp(a,b,c + 1,d,x,y) + 1);
if(d < 13) v += (13.0 - d) / sum * (dp(a,b,c,d + 1,x,y) + 1);
if(x == 4)
{
double t = INF;
for(int i = 0;i < 4;i ++) t = min(t,1.0/sum * (dp(a,b,c,d,i,y) + 1)); // 如果题目变成大小鬼任意放到一叠牌堆,写法又不一样,请斟酌体会!
v += t;
}
if(y == 4)
{
double t = INF;
for(int i = 0;i < 4;i ++) t = min(t,1.0/sum * (dp(a,b,c,d,x,i) + 1));
v += t;
}
return v;
}
int main()
{
cin >> A >> B >> C >> D;
memset(f,-1,sizeof f); // !!!!
double t = dp(0,0,0,0,4,4);
if(t > INF / 2) t = -1;
printf("%.3lf\n",t);
return 0;
}