redirecting to stdout in betwen command

can anyone help me in making singleline command for

Capital Letters are folders ,small letter are files

X,Y,Z are subfolders of A

as shown below

A - X,Y,Z

Folder X has three files a.txt,b.txt,c.txt similarly Y,Z.
as shown below

X- a.txt,b.txt,c.txt
Y- a.txt,b.txt,c.txt
Z- a.txt,b.txt,c.txt

Now i want the count no.of files in all subfolders in A

comp:A admin$ ls | xargs wc -l

will give the count in each folder

but what i want is to print X and its count also

X
3
Y
3
Z
3

Now what i want is to print "X" on screen before its piping to xargs

MAINIDEA: The main idea of this question is it possible to redierct output to screen before piping to another command

eg: i tried just like

comp:A admin$ ls | xargs tee |xargs wc -l
comp:A admin$ ls | tee |xargs wc -l

but not working any ideas???

count no.of files in all subfolders in A

find /A -type f |wc -l

MAINIDEA: The main idea of this question is it possible to redierct output to screen before piping to another command

use strict;
use warnings;
use Data::Dumper;
my $var1=shift;
my $var;
    if( -d $var1)
    {
opendir(DIR,$var1);
my @array=readdir(DIR);
foreach(@array)
{
    $var=$var1."/".$_;
    if($var eq "." || $var eq "..")
    {
        next;
    }
    if( -d $var)
    {

        opendir(DIR1,"$var") or die "Can't Open: $!\n";
        my @array1=readdir(DIR1);
        my $count=$#array1-1;
        print $_ .":".$count."\n" unless $_ eq ".." || $_ eq ".";
    }
}

}
    else
    {
        print "else\n";
        exit
    }
ls | tee >(wc -l)