AT_abc401_b [ABC401B] Unauthorized
Description
One day, Takahashi performed $ N $ operations on a certain web site.
The $ i $ ‑th operation $ (1 \le i \le N) $ is represented by a string $ S_i $ , which is one of the following:
- $ S _ i= $ `login`: He performs a login operation and becomes logged in to the site.
- $ S _ i= $ `logout`: He performs a logout operation and becomes not logged in to the site.
- $ S _ i= $ `public`: He accesses a public page of the site.
- $ S _ i= $ `private`: He accesses a private page of the site.
The site returns an **authentication error** if and only if he accesses a private page while he is not logged in.
Logging in again while already logged in, or logging out again while already logged out, does **not** cause an error. Even after an authentication error is returned, he continues performing the remaining operations.
Initially, he is not logged in.
Print the number of operations among the $ N $ operations at which he receives an authentication error.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ S_1 $ $ S_2 $ $ \vdots $ $ S_N $
Output Format
Print the number of times Takahashi receives an authentication error.
Explanation/Hint
### Sample Explanation 1
The result of each operation is as follows:
- Takahashi becomes logged in.
- He accesses a private page. He is logged in, so no error is returned.
- He accesses a public page.
- He becomes logged out.
- He accesses a private page. He is not logged in, so an authentication error is returned.
- He accesses a public page.
An authentication error occurs only at the 5th operation, so print `1`.
### Sample Explanation 2
If he tries to access private pages consecutively while not logged in, he receives an authentication error for each such operation.
Note that logging out again while already logged out does not cause an authentication error.
### Constraints
- $ 1 \le N \le 100 $
- $ N $ is an integer.
- Each $ S_i $ is one of `login`, `logout`, `public`, `private`. $ (1 \le i \le N) $