Counting a specific character in a string

I’m making a little program that has to count specific characters in a string.
Let’s say the user inputs a name (I.e. “John Jabbadoo Jackson”) and I need to count all the o’s in the string. In this case it should be 4.
How would the script look like?