#include <string>
#include <iostream>
#include <iomanip>
#include <algorithm>

using namespace std;


int main(int argc, const char * argv[])
{
    int total = 0, bad = 0;
    string s = "0123456789";
    do {
        if (s[0] < '3' || s[1] < '3' || s[2] < '3' || s[3] < '3') bad++;
        total++;
    } while(next_permutation(s.begin(),s.end()));
    cout << double(bad)/total << endl;
}
