题目描述
Problem Description
kkksc03 is an extraordinary visionary! In a short period, he has conceived a large number of web pages and always hands them over to the poor lzn to implement.
The Luogu web interface has many folders, and these folders contain other folders.
For example: /luogu/application/controller represents a folder named luogu under the root directory, which contains a folder named application, and within that, a folder named controller.
Each path starts with the character / and does not have two consecutive / characters, nor does it end with /. All names consist only of digits and lowercase letters.
Currently, the root directory is empty. kkksc03 has thought of many folder paths that should exist. The question is, how many new folders need to be created to ensure these folders exist?
Input Format
The first line of the input file is a positive integer \( N \).
The next \( N \) lines each contain a string describing a path, with lengths not exceeding 100.
Output Format
The output should contain \( N \) lines, each with one positive integer. The \( i \)-th line should output the minimum number of new folders needed to ensure the existence of the first \( i \) paths.
Sample Input and Output
Sample Input #1
2
/luogu/application/controller
/luogu/application/view
Sample Output #1
3
4
Sample Input #2
3
/chicken
/chicken/egg
/chicken
Sample Output #2
1
2
2
Sample Input #3
4
/a
/a/b
/a/c
/b/b
Sample Output #3
1
2
3
5
Notes
Data Range and Constraints
- For 20% of the data, \( N \leq 20 \);
- For 50% of the data, \( N \leq 200 \);
- Additionally, 30% of the data have at most two
/characters (including the first character) in all paths; - For all data, \( N \leq 1000 \).
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分