시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 203 129 120 65.934%

문제

어린이 N명이 식탁에 앉아서 쿠키를 먹고 있다. 아이들은 턴을 번갈아가면서 테이블 위의 쿠키를 하나씩 집어온다.

어떤 아이는 식사 예절을 아직 배우지 않았기 때문에, 자신의 턴을 기다리지 않고 쿠키를 집어 오기도 한다. 만약, 어떤 어린이가 쿠키를 집는 그 순간에, 다른 아이들이 가지고 있는 쿠키 개수의 합 보다 많은 쿠키를 가지고 있다면, 선생님에게 혼나게 된다. (집으려고 하는 쿠키는 포함하지 않는다)

아이들이 쿠키를 집어가는 순서가 주어졌을 때, 선생님께 몇 번 혼나는지 구하는 프로그램을 작성하시오. 모든 아이는 한 번에 쿠키 하나를 집어간다.

입력

첫째 줄에 집어갈 수 있는 쿠키의 개수 N이 주어진다. (1 ≤ N ≤ 100)

다음 N개 줄에는 어린이의 이름이 쿠키를 집어간 순서대로 주어진다. 이름은 알파벳으로 이루어진 길이 20자 이하의 문자열이다.

출력

첫째 줄에 선생님께 몇 번 혼나는지를 출력한다.

예제 입력 1

4
mirko
stanko
stanko
stanko

예제 출력 1

1
W3sicHJvYmxlbV9pZCI6IjMwMjIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyZGRcdWMwYWMgXHVjNjA4XHVjODA4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM1YjRcdWI5YjBcdWM3NzQgTlx1YmE4NVx1Yzc3NCBcdWMyZGRcdWQwYzFcdWM1ZDAgXHVjNTQ5XHVjNTQ0XHVjMTFjIFx1Y2ZlMFx1ZDBhNFx1Yjk3YyBcdWJhMzlcdWFjZTAgXHVjNzg4XHViMmU0LiBcdWM1NDRcdWM3NzRcdWI0ZTRcdWM3NDAgXHVkMTM0XHVjNzQ0IFx1YmM4OFx1YWMwOFx1YzU0NFx1YWMwMFx1YmE3NFx1YzExYyBcdWQxNGNcdWM3NzRcdWJlMTQgXHVjNzA0XHVjNzU4IFx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