Finding the number of John in Titanic Dataset

In Titanic Dataset, how do I find out how many Johns there are in passengers’ names?

You can do something like:

length(grep(‘John’, titanic.data$Name))