#include <iostream>
#include <cstdio>
#include <cmath>
#include <assert.h>

using namespace std;

const long double EPS = 1e-7;

long double win, lose;
long double wh, lh, wa, la; 

bool is_home(int cur_win, int cur_lose)
{
    int num = cur_win + cur_lose;
    return num == 0 || num == 1 || num == 4 || num == 6;
}

long double solve (long double cur, int cur_win, int cur_lose)
{
    if (cur_win == win && cur_lose == lose) return cur;
    if (cur_win > win || cur_lose > lose) return 0;
    if (cur_win == 4 || cur_lose == 4) return 0;
    if (is_home(cur_win, cur_lose))
        return solve(cur * wh, cur_win + 1, cur_lose) +
               solve(cur * lh, cur_win, cur_lose + 1);
    else
        return solve(cur * wa, cur_win + 1, cur_lose) +
               solve(cur * la, cur_win, cur_lose + 1);
};

int main()
{
    freopen("gagarincup.in", "r", stdin);
    freopen("gagarincup.out", "w", stdout);
    cin >> wh >> lh >> wa >> la;
    string score;
    cin >> score;

    assert(0 <= wh && wh <= 1);
    assert(0 <= wa && wa <= 1);
    assert(0 <= lh && lh <= 1);
    assert(0 <= la && la <= 1);

    assert(fabs(wh + lh - 1.0) <= EPS);
    assert(fabs(wa + la - 1.0) <= EPS);

    win = score[0] - 48;
    lose = score[2] - 48;
    assert(score[1] == '-');
    
    assert(0 <= win && win <= 4);
    assert(0 <= lose && lose <= 4);

    int game = lose + win;

    assert(0 <= game && game <= 7);

    long double ans = solve(1.0, 0, 0);
    cout.precision(20);
    cout << fixed << ans << endl;
}


