SET @t0:=concat(YEAR(now()),'-',MONTH(now()),'-1');
SET @t1:=adddate(@t0,INTERVAL 1 MONTH);
SET @s:='ttddfftdfttttddddffffffdffff';
SET @t3:=week(@t0)+IF(weekday(@t0)>3,1,0);
SET @t4:=week(@t1)-IF(weekday(@t0)<=3,1,0)+1;
SELECT SUM(LENGTH(REPLACE(SUBSTRING(@s,@t3,@t4-@t3),'f','')))