Wibowo and his girlfriend play with a deck of 52 distinct cards. Each card has a number and a suit.
When two cards are compared, the card with the higher number wins. If both cards have the same number, the card with the stronger suit wins. Because the deck contains no duplicates, one card always beats the other.
The deck is split so that Wibowo and his girlfriend each hold 26 cards. The game lasts 26 rounds. In each round both players simultaneously reveal one card from their hand and compare them; the owner of the winning card scores one point.
Wibowo knows exactly which 26 cards he holds (his girlfriend holds the other 26). Assuming he can pair his cards against hers in the most favourable order, determine the maximum number of points Wibowo can score.
The first line contains an integer T (T≤100), the number of test cases.
Each of the next T lines describes one test case and contains Wibowo's 26 cards separated by single spaces. Each card is written with two characters: the first is its number and the second is its suit.
All 26 cards in a hand are distinct.
For each test case, print on its own line a single integer: the maximum number of points Wibowo can score with the given hand.