Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/string-harf-necha-marta

How many times a letter occurs

Easy 1000 ms 128 MB 22%
Share

A string $s$ of lowercase Latin letters and a letter $c$ are given. Find how many times $c$ occurs in the string.

Counting the characters of the string that match the given one

Input

The first line contains the string $s$, the second line a single letter $c$.

Output

One integer.

Note

$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters (a–z) only
$c$ is a lowercase Latin letter

Examples

Input #1
banana
a
Output #1
3
Input #2
salom
z
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.