Please help. I am a beginner.

Alrigt, I need to write a shell script where it counts the number of folders and files and dispays "My home directory has 'x' files and 'y' directories."
So, I was thinking of doing this.

set x = `ls | wc`
so, if I have 8 files and folders in my home directory, x is not 8.
now, I was thinking, of typing ls -p, thus directories are shown with '/' as their last character, so I could get the number of directories by 'grep'ing the words that contain '/' as their last character and se that value as y. That is the number of directories. Next is files, which is easy, just x-y.
But now, for the y value, what do I type?
I have been trying a bounch of commands but I cannot get it to work.

Thank you for your time.

Please take a look at our rules - homework questions are not permitted.

Thanks
ZB