SP1444 DELCOMM2 - DEL Command II

Description

It is required to find out what's the maximum number of files that can be deleted from MS-DOS directory executing the DEL command of MS-DOS operation system only once. There are no nested subdirectories.

Input Format

The first line of the input is an integer M, then a blank line followed by M datasets. There is a blank line between datasets. Input data for each dataset contains a list of full file names without any extra empty lines and spaces. Each name is written in a separate line of input data file and ended with a control sign: '+' for delete or '-' for keep. Full file names are not repeated. The list comprises at least one file, and at least one file is marked to be deleted. There are no more than 250 files.

Output Format

For each dataset, write to the first line of output the maximum number of files one DEL command can delete.