AT_arc097_c [ARC097E] Sorted and Sorted

Description

[problemUrl]: https://atcoder.jp/contests/arc097/tasks/arc097_c それぞれ $ 1 $ から $ N $ の整数が $ 1 $ つずつ書かれた白いボールと黒いボールが合わせて $ 2N $ 個一列に並んでいます。 左から $ i $ ($ 1 $ $

Input Format

入力は以下の形式で標準入力から与えられる。 > $ N $ $ c_1 $ $ a_1 $ $ c_2 $ $ a_2 $ $ : $ $ c_{2N} $ $ a_{2N} $

Output Format

目標を達成するために必要な操作回数の最小値を出力せよ。

Explanation/Hint

### 制約 - $ 1 $ $