#C2102. Count Character Occurrences

    ID: 45382 Type: Default 1000ms 256MiB

Count Character Occurrences

Count Character Occurrences

Given a string S and a character C, count the number of times C appears in S. Formally, if we denote by \(S\) the input string and by \(C\) the given character, you are required to compute:

\[ K = \#\{i \mid S[i] = C\} \]

Your program should read the input from standard input (stdin) and output the result to standard output (stdout).

inputFormat

The input consists of two lines:

  • The first line contains the string S. This string may include spaces and special characters.
  • The second line contains a single character C whose occurrences need to be counted.

outputFormat

Output a single integer representing the number of times the character C appears in the string S.

## sample
hello
o
1