Under construction

Still being built. Things may change

Finding DKSH

Time limit1sMemory limit1024 MB

Summary
Count the occurrences of the substring DKSH in a string of at most 1,000 characters made of D, K, S, and H.
Level

Easy1 of 10

Topics
String, String matching
Solved
No attempts yet

Problem

DKSH is the school logo, an abbreviation of Dankook University Software High School.

You are given a string made only of the characters D, K, S, and H. Count how many times DKSH appears in this string.

Input

The first line contains the string. The length of the string does not exceed 1 0001\,000.

Output

Print the number of times DKSH appears in the input string on the first line.

Examples3

  1. Example 1

    Input
    DKKSSH
    
    Expected output
    0
    
  2. Example 2

    Input
    HDKSHDDKS
    
    Expected output
    1
    
  3. Example 3

    Input
    SDKSHSSDKSHS
    
    Expected output
    2