P26681 [AtCoder] "く"
提高+
题目描述

Problem Description

Iroha-chan wrote "く" several times in a column on paper. However, due to her exceptional calligraphy skills, all the "く"s merged into a single line. To make it easier to read later, let's count how many "く"s Iroha-chan wrote.

Input Format

The input is given in the following format:

$ N $ $ C_1 $ $ C_2 $ $\vdots$ $ C_N $

An integer $ N $ is given, followed by $ N $ lines of either / or \ characters $C_i(1\ \leq\ i\ \leq\ N)$. If the character is /, it means the line drawn by Iroha-chan extends downwards to the left by a length of $ 1 $. If the character is \, it means the line extends downwards to the right by a length of $ 1 $. When the length of the line extending downwards to the right is equal to the length of the line that previously extended downwards to the left, these two lines together form a "く". (Updated on 5/2 13:54)

Output Format

Output the number of "く"s in the lines drawn by Iroha-chan.

Sample Input and Output

Sample Input #1

5
/
\
/
/
\

Sample Output #1

1

Sample Input #2

6
/
\
/
/
\
\

Sample Output #2

2

Sample Input #3

13
\
/
/
\
\
/
\
/
\
\
\
/
\

Sample Output #3

3

Notes/Hints

Constraints

  • $ C_i $ is either / or \
  • $1\ \leq\ N\ \leq\ 10^5$

Explanation

Explanation

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 / \ / / \
样例输出
1