문제
Farmer John has cows in a line (). Unfortunately, there is a sickness spreading throughout.
Initially, some cows start off infected. Every night, an infected cow spreads the sickness to the cows on their left and right (if they exist). Once a cow is infected, she stays infected.
After some amount of nights, Farmer John realizes that the issue has gotten out of control, so he tests his cows to determine who has the sickness. Find the minimum number of cows that could have started with the sickness.
입력
The first line contains , the number of cows that Farmer John has.
The next line contains an character bitstring of only s and s where a represents an infected cow and a represents an uninfected cow after some number of nights.
출력
Output a single integer: the minimum number of cows that could have started with the sickness.
예제 입력 1
5
11111
예제 출력 1
1
예제 입력 2
6
011101
예제 출력 2
4
점수
Inputs 3-7: Inputs 8-12: No additional constraints.
코드를 제출하려면 로그인이 필요합니다.
로그인