B - Isolated Seats 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MiB

配点 : 200

問題文

ox からなる長さ N の文字列 S が与えられます。
N 個の椅子が左右一列に並んでおり、左から i 番目の椅子には、Si 文字目が o ならば人が座っており、x ならば人は座っていません。
以下の条件をすべて満たす椅子は何個あるか求めてください。

  • 人が座っていない
  • 左に椅子が無い、または左の椅子に人が座っていない
  • 右に椅子が無い、または右の椅子に人が座っていない

制約

  • 1 \leq N \leq 100
  • N は整数
  • Sox からなる長さ N の文字列

入力

入力は以下の形式で標準入力から与えられる。

N  
S  

出力

答えを 1 行で出力せよ。


入力例 1

8
xxoxxxox

出力例 1

2

左から 1,5 番目の椅子のみが条件を満たします。


入力例 2

5
ooooo

出力例 2

0

入力例 3

1
x

出力例 3

1

Score : 200 points

Problem Statement

You are given a string S of length N consisting of o and x.
N chairs are arranged in a row from left to right. If the i-th character of S is o, a person is sitting in the i-th chair from the left; if it is x, no person is sitting there.
Find the number of chairs that satisfy all of the following conditions.

  • No person is sitting in it.
  • There is no chair to its left, or no person is sitting in the chair to its left.
  • There is no chair to its right, or no person is sitting in the chair to its right.

Constraints

  • 1 \leq N \leq 100
  • N is an integer.
  • S is a string of length N consisting of o and x.

Input

The input is given from Standard Input in the following format:

N  
S  

Output

Output the answer in one line.


Sample Input 1

8
xxoxxxox

Sample Output 1

2

Only the first and fifth chairs from the left satisfy the conditions.


Sample Input 2

5
ooooo

Sample Output 2

0

Sample Input 3

1
x

Sample Output 3

1