# -*- coding: utf-8 -*-
"""
Created on Thu Jun  6 11:34:07 2019

@author: Aryan Kumar
"""

s1 = ""
s1 = input("Enter a string:")
i = input("Enter the character: ")
count = j = 0
for i in s1:
    if i == s1[j]:
        count += 1

print(count)
