AT_past202303_h 3 枚階段

Description

You have a hand of $ N $ cards. The $ i $ -th card $ (1 \leq i \leq N) $ has an integer $ A_i $ written on it. You can perform the following operation any number of times. - Choose three cards with consecutive integers written on them, and discard them from hand. In other words, for some integer $ x $ , choose a card with $ x $ , a card with $ x+1 $ , and a card with $ x+2 $ written on them, and discard them from hand. What is the minimum possible number of cards in your final hand?

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ \ldots $ $ A_N $

Output Format

Print the answer.

Explanation/Hint

### Sample Explanation 1 After the following two operations, your hand will have one card, which is the minimum possible. - Choose cards with $ 1 $ , $ 2 $ , $ 3 $ written on them, and discard them. - Choose cards with $ 4 $ , $ 5 $ , $ 6 $ written on them, and discard them. ### Constraints - $ 3 \leq N \leq 3 \times 10^5 $ - $ 1 \leq A_i \leq 10^{18} \, (1 \leq i \leq N) $ - All values in the input are integers.