P28368 [洛谷] [COCI2017-2018#3] Aron
普及-
题目描述

Problem Description

The holiday season is approaching! Aron wants to buy gifts for his friends in Zagreb, so he visits a famous toy store in London to ensure timely delivery. After selecting the gifts, he heads to the checkout counter and finds that there are already \( N \) people in line. Fortunately, he notices that there are groups of people in addition to individual customers. A group consists of a customer and their friends waiting for them to complete their purchase. Once the customer finishes shopping, they and their friends leave the line.

People considered part of a group are standing one behind the other and are wearing shirts of the same color. Two adjacent groups, adjacent individuals, or an adjacent individual and a group will never be wearing shirts of the same color.

Write a program that, given the data on the people standing in line, outputs which position in line Aron is.

Input Format

The first line of input contains the positive integer \( N \) (1 ≤ \( N \) ≤ 25) from the task. Each of the following \( N \) lines contains a single character, an uppercase letter of the English alphabet representing the shirt color of the \( i \)-th person in line.

Output Format

You must output the required number from the task.

Sample Input and Output

Sample Input #1

3
C
Z
P

Sample Output #1

4

Sample Input #2

6
C
C
P
C
Z
Z

Sample Output #2

5

Sample Input #3

6
B
B
B
B
B
B

Sample Output #3

2

Notes

Clarification of the second test case:

The first in line is a group consisting of two people in red shirts. The second in line is an individual in a blue shirt, the third in line is an individual in a red shirt, and the fourth in line is a group in green shirts. This makes Aron the fifth in line.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 C Z P
样例输出
4