Competitions
Week 6: December 14 - 20. Char arrays 1
Count the letters
Given a string s and a letter c. How many times the letter appears in the string?
Input
First line contains string s with no more than 100 symbols. Second line contains lowercase letter c of Latin alphabet.
Output
Print how many times letter c appears in the string s. Uppercase and lowercase letter considered the same. For example, 'a' and 'A' considered the same letters.
Input example #1
Programming Principles 1 p
Output example #1
3
Input example #2
This is a cat sitting on a table t
Output example #2
5