function my_action_replace () {
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
if ('free_shipping:1' == $chosen_methods[0]) {
echo '3r';
}
if ('free_shipping:3' == $chosen_methods[0]) {
echo '5r';
}
}
add_filter ('woocommerce_cart_totals_taxes_total_html', 'my_action_replace');