#abc375a. A - Seats
A - Seats
Score : points
问题陈述
有一排个座位,编号为。
座位的状态由一个长度为的字符串给出,由#
和.
组成。如果的第个字符是#
,则表示座位被占用;如果是.
,则表示座位是空的。
找出满足以下条件的整数的数量(包括和):
- 座位和被占用,座位是空的。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
There are seats in a row, numbered .
The state of the seats is given by a string of length consisting of #
and .
. If the -th character of is #
, it means seat is occupied; if it is .
, seat is unoccupied.
Find the number of integers between and , inclusive, that satisfy the following condition:
- Seats and are occupied, and seat is unoccupied.
Constraints
- is an integer satisfying .
- is a string of length consisting of
#
and.
.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
6
#.##.#
Sample Output 1
2
and satisfy the condition, so the answer is .
Sample Input 2
1
#
Sample Output 2
0
Sample Input 3
9
##.#.#.##
Sample Output 3
3