#include using namespace std; vector memo[1 << 14]; int main() { int A, N; double P[3]; cin >> A >> P[0] >> P[1] >> P[2]; N = 80 - A; for (int i = 0; i < 3; i++) { P[i] /= 100; } double dp[2][1 << 14] = {}; int now = 0, nxt = 1; dp[now][(1 << 14) - 1] = 1; auto prob = [&](int bit, int mask) { double ret = 1; for (int x = 0; x < 14; x++) { int cnt = 0; if (x != 0 && (bit & (1 << (x - 1)))) cnt++; if (x != 13 && (bit & (1 << (x + 1)))) cnt++; if (bit & (1 << x) && !(mask & (1 << x))) ret *= P[cnt]; else if (bit & (1 << x) && (mask & (1 << x))) ret *= 1 - P[cnt]; } return ret; }; for (int bit = 0; bit < (1 << 14); bit++) { for (int mask = bit; mask >= 0; mask--) { mask &= bit; memo[bit].emplace_back(prob(bit, mask)); } } while (N--) { for (int bit = 0; bit < (1 << 14); bit++) { dp[nxt][bit] = 0; } for (int bit = 0; bit < (1 << 14); bit++) { int cnt = 0; for (int mask = bit; mask >= 0; mask--) { mask &= bit; dp[nxt][mask] += dp[now][bit] * memo[bit][cnt]; cnt++; } } swap(now, nxt); } double ans = 0; for (int bit = 0; bit < (1 << 14); bit++) { ans += dp[now][bit] * __builtin_popcount(bit); } cout << fixed << setprecision(10) << ans * 2 << endl; }