Horizontal lines P74306


Statement
 

pdf   zip

thehtml

Your task is to write a program that computes the number of horizontal lines contained in a given rectangle of characters. We consider that an horizontal line is a sequence of two or more dashes consecutive horizontally.

Input

The input starts with two naturals n ≥ 1 and m ≥ 1, followed by n lines, each one with m ‍characters. All the characters are dashes and lowercase letters.

Output

Your program must print the number of horizontal lines contained in the given rectangle.

Public test cases
  • Input

    4 10
    bb--cd----
    a--f--d--d
    abcdefghij
    ---z------
    

    Output

    7
    
  • Input

    3 3
    -a-
    a-a
    -a-
    

    Output

    0
    
  • Input

    1 2
    --
    

    Output

    1
    
  • Input

    5 1
    -
    a
    -
    b
    -
    

    Output

    0
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Spanish
    Other languages
    Spanish
    Official solutions
    C++
    User solutions
    C++