Browser Games
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

The memory limit of this problem (32 megabytes) is unusual!

In the upcoming  days, browser games will be released on a new website. According to the plan, the administrator will release a new game per day. Users have to open the corresponding URL (Uniform Resource Locator) and get feedback from the server to download a game.

However, the setup of the server uses unreadable legacy codes. Once a user somehow finds the URL of an unreleased game, the data of the game would leak out. To temporarily fix the problem, the administrator decided to add a series of confirmation prefixes, which are non-empty strings, at the server-side. The server will respond with the correct game data when the requested URL does correspond to a game (no matter released or unreleased) and at least one confirmation prefix is a prefix of the URL; otherwise, the server will declare that the game is not found.

To make the work easier, the administrator asks you to find the minimum number of confirmation prefixes the server required to avoid data leaks every time after a new game release.

输入描述:

The first line contains an integer , indicating the number of browser games to be released.

In the next  lines, the -th line contains a non-empty string, consisting of only lowercase letters (`a' to `z'), uppercase letters (`A' to `Z'), digits (`0' to `9'), dots (`.') and forward slashes (`/'), indicating the URL of the browser game released on the -th day.

It is guaranteed that the length of each given URL is at most 100, and no given URL is the prefix of any other given URL.

输出描述:

Output  lines, the -th of which contains an single integer, indicating the minimum number of required confirmation prefixes after the -th new game released.

示例1

输入

复制
3
ufoipv.ofu
hsbocmvfgboubtz.kq
hfotijo.njipzp.dpn/kb

输出

复制
1
2
2

备注:

The explanation for the sample case is given as follows.


- In the first day, the game with URL ufoipv.ofu has been released, while the other two games should be unavailable. Thus taking ``u'' as the only confirmation prefix is sufficient.

- In the second day, the games with URL ufoipv.ofu and hsbocmvfgboubtz.kq have been released, while the game with URL hfotijo.njipzp.dpn/kb should still be unavailable. Thus taking ``u'' and ``hs'' as confirmation prefixes is sufficient. Note that taking ``u'' and ``h'' as confirmation prefixes is not fesible, which may lead to data leaks of the game with URL hfotijo.njipzp.dpn/kb.

- In the last day, all the three games have been released. Thus taking ``u'' and ``h'' as confirmation prefixes is sufficient. Note that taking an empty string as the only confirmation prefix is not allowed, since the confirmation prefixes should be non-empty.