AT_abc423_b [ABC423B] Locked Rooms

Description

There are $ N + 1 $ rooms arranged in a line, numbered $ 0, 1, \ldots, N $ in order. Between the rooms, there are $ N $ doors numbered $ 1, 2, \ldots, N $ . Door $ i $ is between rooms $ i - 1 $ and $ i $ . For each door, a value $ L_i $ representing the lock state is given. When $ L_i = 0 $ , door $ i $ is unlocked, and when $ L_i = 1 $ , door $ i $ is locked. There are two people, one in room $ 0 $ and the other in room $ N $ . Each person can move between rooms $ i - 1 $ and $ i $ only when door $ i $ is unlocked. Find the number of rooms that neither of the two people can reach.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ L_1 $ $ L_2 $ $ \ldots $ $ L_N $

Output Format

Output the answer.

Explanation/Hint

### Sample Explanation 1 The rooms that neither of the two people can reach are rooms $ 2, 3, 4 $ , which is $ 3 $ rooms. ### Constraints - $ 2 \leq N \leq 100 $ - $ L_i \in \lbrace 0, 1 \rbrace $ - All input values are integers.