cswork / OA打开练习工作台

NvidiaOA #6

Palindromic Strings

估计中等可在线判题

考点(AI 标注)贪心调度哈希计数

You may swap any two characters any number of times, including swaps within the same string. Each string keeps its length. Maximize the final number of palindromic strings.

This site uses a standard input/output protocol.

输入格式

The first line contains N, followed by N lines of non-empty lowercase strings. This site uses 1≤N≤100000 and a total of ≤1000000 characters.

输出格式

Output a single integer, the answer.

样例 1

输入:

2
ab
cd

输出:

0

样例 2

输入:

2
ab
ba

输出:

2

样例 3

输入:

2
abc
a

输出:

2

样例说明

Example 1: the four characters are all different, so there are no matching pairs; the answer is 0. Example 2: rearrange into aa and bb; the answer is 2. Example 3: rearrange into aba and c; the answer is 2.