Morse code
题号:NC200596
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Morse code is a character encoding scheme used in telecommunication that encodes text characters as standardized sequences of two different signal durations called dots and dashes or dits and dahs. Morse code is named for Samuel F. B. Morse, an inventor of the telegraph.

Space is used to split Morse code, but if all spaces are lost, then the Morse code may have many meanings.For example: ".-. "can be translated to "AE"or "EN"or "R", but the string translated from Morse code can’t contain ’E’ and ’T’. So "R"is the longest string it can represent. Now hery is given a Morse code, he wants to know the length of the longest string it can represent.

输入描述:

The first line is an integer T, the number of test cases.
Next T lines, each line contains a Morse code consist of ’.’ and ’-’.
(1 ≤ T ≤ 100, the number of characters input will not exceed ).

输出描述:

For each Morse code ,output the length of the longest string it can represent.
示例1

输入

复制
2
..--.-.
--.-.--

输出

复制
3
3