#abc375a. A - Seats

A - Seats

Score : 100100 points

问题陈述

有一排NN个座位,编号为1,2,,N1, 2, \ldots, N

座位的状态由一个长度为NN的字符串SS给出,由#.组成。如果SS的第ii个字符是#,则表示座位ii被占用;如果是.,则表示座位ii是空的。

找出满足以下条件的整数ii的数量(包括11N2N-2):

  • 座位iii+2i+2被占用,座位i+1i+1是空的。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

There are NN seats in a row, numbered 1,2,,N1, 2, \ldots, N.

The state of the seats is given by a string SS of length NN consisting of # and .. If the ii-th character of SS is #, it means seat ii is occupied; if it is ., seat ii is unoccupied.

Find the number of integers ii between 11 and N2N - 2, inclusive, that satisfy the following condition:

  • Seats ii and i+2i + 2 are occupied, and seat i+1i + 1 is unoccupied.

Constraints

  • NN is an integer satisfying 1N2×1051 \leq N \leq 2 \times 10^5.
  • SS is a string of length NN consisting of # and ..

Input

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

NN

SS

Output

Print the answer.

Sample Input 1

6
#.##.#

Sample Output 1

2

i=1i = 1 and 44 satisfy the condition, so the answer is 22.

Sample Input 2

1
#

Sample Output 2

0

Sample Input 3

9
##.#.#.##

Sample Output 3

3