String repair
#描述#
z_y recently invent a technique of repairing String that contains illegal segments. For the sake of simplicity, a String is only made up of lowercase. The repairing technique is simply to replace some characters with ‘A’ to eliminate all illegal segments. For example, we can repair a String "abvdhg" to "abAdhA" to eliminate the initial illegal segments "abv" and "hg" by changing two characters.
You are to help z_y to repair a String by changing least number of characters.
#格式#
##输入格式##
The input consists of multiple test cases. Each test case starts with a line containing one integers N (1 ≤ N ≤ 50), which is the number of illegal segments.
The following N lines gives N non-empty Strings of length not greater than 20 containing only lowercase, which are the illegal segments.
The last line of the test case is a non-empty string of length not greater than 500 containing lowercase, which is the String to be repaired.
##输出格式##
For each test case, print a line containing the test case number( beginning with 1) followed by the
number of characters which need to be changed.
#样例1#
##样例输入1##
2
abv
dh
abvdhf
2
abc
bcd
abcde
##样例输出1##
Case 1: 2
Case 2: 1
#限制#
1000ms
32768KB
#提示#
#来源#
z_y