There are two decks of cards lying on the table in front of you, some cards in these decks lay face up, some of them lay face down. You want to merge them into one deck in which each card is face down. You're going to do it in two stages.

The first stage is to merge the two decks in such a way that the relative order of the cards from the same deck doesn't change. That is, for any two different cards *i* and *j* in one deck, if card *i* lies above card *j*, then after the merge card *i* must also be above card *j*.

The second stage is performed on the deck that resulted from the first stage. At this stage, the executed operation is the turning operation. In one turn you can take a few of the top cards, turn all of them, and put them back. Thus, each of the taken cards gets turned and the order of these cards is reversed. That is, the card that was on the bottom before the turn, will be on top after it.

Your task is to make sure that all the cards are lying face down. Find such an order of merging cards in the first stage and the sequence of turning operations in the second stage, that make all the cards lie face down, and the number of turns is minimum.
The first input line contains a single integer *n* — the number of cards in the first deck (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>).

The second input line contains *n* integers, separated by single spaces *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 1). Value *a*<sub class="lower-index">*i*</sub> equals 0, if the *i*-th card is lying face down, and 1, if the card is lying face up. The cards are given in the order from the topmost one to the bottommost one.

The third input line contains integer *m* — the number of cards in the second deck (1 ≤ *m* ≤ 10<sup class="upper-index">5</sup>).

The fourth input line contains *m* integers, separated by single spaces *b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*m*</sub> (0 ≤ *b*<sub class="lower-index">*i*</sub> ≤ 1). Value *b*<sub class="lower-index">*i*</sub> equals 0, if the *i*-th card is lying face down, and 1, if the card is lying face up. The cards are given in the order from the topmost to the bottommost.
print("_RANDOM_GUESS_1689172721.3433979")# 1689172721.343411