public class Main {
    public static void main(String[] args) {
        String string = "H e l l o ! n o w c o d e r";
        Scanner scanner= new Scanner(System.in);
        String word = scanner.next();
        scanner.close();
        System.out.println(check(string, word));
    }

    public static int check(String str, String word) {
        int count=0;
        int i;
        for( i=0;i<=str.length()-1;i++){
            //java中string的便利方法charAt
            if(str.charAt(i)==word.charAt(0)){
                count+=1;
            }
        }
        
        return count;

        //write your code here......
        

    }
}