#include <bits/stdc++.h>
using namespace std;


int main() {
    string s = "00000000001111111111";            // red and white roses 
    sort(s.begin(), s.end());
  
    int total_permutations = 0;
    int count_in_church = 0;
  
  
    // check next lexicographic permutation of s 
    do {
        total_permutations += 1;
  
        // check if bride steps into church by checking if
        // the number of ones exceeds the number of zeros
        int cnt_0 = 0;
        int cnt_1 = 0;
        
        for (char c : s) {
        	if (c == '0') {cnt_0 += 1;}
        	else {cnt_1 += 1;}
        	
        	if (cnt_1 > cnt_0) {
        		count_in_church += 1;
        		break;
        	}
        }
        
    } while(std::next_permutation(s.begin(), s.end()));
  
  
    cout << "number of times bride entered church: " << count_in_church << '\n';
    cout << "total permutations: " << total_permutations << '\n';
    cout << "probability: " << 1.0 * count_in_church / total_permutations << '\n';
}