SDE Path

Count Occurrences of a Character

Easy

Count Occurrences of a Character

Count how many times a character appears in a word.

Input format

A single line with a word S and a single character C, separated by a space.

Output format

Print how many times C appears in S.

Constraints

  • Values fit in a 64-bit signed integer
  • Trailing whitespace and a trailing newline are ignored by the judge

Read from stdin, write to stdout. Sample cases below show the exact format.

Sample cases

Example 1
Input
banana a
Expected output
3
Example 2
Input
hello l
Expected output
2