#P120. [KSC002B] 字符计数

[KSC002B] 字符计数

Source

This problem is adapted from Long Long OJ and proposed by . All rights reserved.

Problem Background

The string is too long, making it hard to count specific characters manually.

Problem Description

Given a string and a target character, count how many times the character appears in the string.

Input Format

  • The first line contains a string ss.
  • The second line contains the target character cc.

Output Format

A single integer representing the count of the target character in the string.

Samples

hahahahaha
a
5

Data Range

  • For 10%10\% of the data, s10\lvert s \rvert \le 10.
  • For 30%30\% of the data, s103\lvert s \rvert \le 10^3.
  • For 50%50\% of the data, s105\lvert s \rvert \le 10^5.
  • For 70%70\% of the data, s106\lvert s \rvert \le 10^6.
  • For 100%100\% of the data, s107\lvert s \rvert \le 10^7.
  • It is guaranteed that ss only contains letters and digits.