Solitaire
**"N-T Solitaire"** is a single-player card game played with **4N** cards, where each card is uniquely defined by a pair consisting of its value (an integer from **1** to **N**) and its suit (♠, ♥, ♦, or ♣). The game begins with all cards distributed across **T** piles (**4** ≤ **T** ≤ **12**). The distribution is such that the first **(4N) Your task is to write a program that calculates the maximum number of cards that can be moved to the discard pile.
Input
The first line contains two integers, **N** and **T**. This is followed by **T** lines, each describing the cards in one pile. Each card is represented by its value (an integer) immediately followed by its suit (a character with ASCII code 03 (♠), 04 (♥), 05 (♦), or 06 (♣)), with no space in between. Cards in a pile are separated by a single space, and they are listed from the bottom to the top of the pile.
### Sample Input
"' 5 4 1♠ 2♠ 3♠ 4♠ 5♠ 1♥ 2♥ 3♥ 4♥ 5♥ 1♦ 2♦ 3♦ 4♦ 5♦ 1♣ 2♣ 3♣ 4♣ 5♣ "'
Output
Your program should output a single integer: the maximum number of cards that can be moved to the discard pile.