#866
Bronze II
PRASE
시간 제한
1s
메모리 제한
32MB
제출
1
정답
1
맞힌 사람
1
정답 비율
100.0%

문제

N children are eating lunch at the table. Children take turns in taking food from the table. Some of the children haven't yet been taught proper manners so they jump at the food without giving the others a chance. If at any point a child takes a piece of food, and that child had already taken more food than the other children all together (not including the new piece of food), then the mother will warn that child to behave.

You will be given the order in which the children take food. Write a program that calculates how many times the mother has to warn the children.

입력

The first line of input contains an integer N (1 ≤ N ≤ 100), how many pieces of food the children take.

Each of the following N lines contains the name of a child that took one piece of food. The names will be strings of at most 20 lowercase letters of the English alphabet.

출력

Output the number of warnings on a single line.

예제 입력 1

4
mirko
stanko
stanko
stanko

예제 출력 1

1

예제 입력 2

17
a
b
b
a
a
a
c
a
b
b
c
b
b
b
b
b
b

예제 출력 2

4
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
#순위사용자언어시간메모리코드 길이
5659🥇
안우진
Python7ms8284KB202B
난이도 투표
Bronze II1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
#사용자문제결과언어시간메모리코드 길이제출 시간
5659
맞았습니다
Python7ms8284KB202B2026. 04. 28. 20:09