B. Six Seven
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

For an array $$$a$$$ of length $$$n$$$, we define the aura of the array to be the number of indices $$$i$$$ ($$$1 \leq i \leq n-1$$$) such that at least one of the following conditions holds:

  • $$$a_i = 6$$$ and $$$a_{i+1} = 7$$$
  • $$$a_i = 7$$$ and $$$a_{i+1} = 6$$$

You are given an array $$$a$$$ of length $$$n$$$. You may perform the following operation any number of times:

  • Choose an index $$$i$$$ ($$$1 \leq i \leq n-1$$$) and swap the elements $$$a_i$$$ and $$$a_{i+1}$$$ in the array $$$a$$$.

After performing the operation some number of times (possibly zero), you would like to know the maximum possible aura of the resulting array $$$a$$$.

Input

The first line of input contains a single integer $$$n$$$ ($$$2 \leq n \leq 100$$$).

The second line of input contains $$$n$$$ integers $$$a_1, a_2, ..., a_n$$$ ($$$1 \leq a_i \leq 100$$$).

Output

Output a single integer — the maximum possible aura of the array $$$a$$$ after performing any number of operations.

Examples
Input
4
1 2 3 4
Output
0
Input
7
2 6 1 7 3 5 4
Output
1
Input
5
6 6 7 7 7
Output
4
Note

In the first example, no number of operations can result in an aura greater than 0.

In the second example, the elements $$$1$$$ and $$$6$$$ can be swapped to obtain $$$[2, 1, 6, 7, 3, 5, 4]$$$, which has an aura of $$$1$$$.