count the B ( blue ) colour
for c in color : NEW_LINE INDENT if ( c == ' B ' ) : NEW_LINE INDENT Blue_Count += 1 ; NEW_LINE DEDENT DEDENT for c in color : NEW_LINE INDENT if ( c == ' B ' ) : NEW_LINE INDENT Blue_Count -= 1 ; NEW_LINE DEDENT if ( c == ' R ' ) : NEW_LINE INDENT Red_Count += 1 ; NEW_LINE DEDENT if ( c == ' G ' ) : NEW_LINE INDENT result += Red_Count * Blue_Count ; NEW_LINE DEDENT DEDENT return result ; NEW_LINE