274 传统题

[ABC375A] 间隔空座 (Seats)

时间限制
2000ms
内存限制
256MiB
登顶 / 尝试
0/ 0
难度
1

[ABC375A] 间隔空座 (Seats)

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 N−2N - 2, inclusive, that satisfy the following condition:

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

Input

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

$N$
$S$

Output

Print the answer.

Example

6
#.##.#
2

Note

  • Constraints:

  • NN is an integer satisfying 1≤N≤2×1051 \leq N \leq 2 \times 10^5.

  • SS is a string of length NN consisting of # and ..

  • Source: ABC375A