题目描述
Problem Background
5ab is trying to help Luogu write a robot to count how many first-level titles are in the solutions.
Problem Description
Markdown is a markup language. In Markdown, if the first non-blank character of a line is a hash symbol (#) followed by one or more spaces, the remaining non-blank content of that line will be rendered as a first-level title.
Within the scope of this problem, the following are considered first-level titles:
# This is a title
# This is another title
# This is also a title
# You#can#add#more#sharps
# #
Within the scope of this problem, the following are not considered first-level titles:
<h1>an HTML title</h1>
#You should insert a space
## This is a secondary title
aaaaa # This is not a title at all
#
You should add something after the sharp sign
Given a multi-line text, determine how many first-level titles are in the text.
Input Format
The first line of input contains an integer $n$, representing the number of lines in the text.
The next $n$ lines contain the marked text.
Output Format
Output a single line containing an integer, which is the number of first-level titles in the text.
Sample Input and Output
Sample Input #1
1
#u#n#t#i#t#l#e#d#
Sample Output #1
0
Sample Input #2
1
# a perfect title
Sample Output #2
1
Sample Input #3
10
# a
# b
## c
#d
#
e
# f#g#h#i#j
##k
# #
l # m
Sample Output #3
4
Notes
Sample 3 Explanation
The 2nd, 3rd, 8th, and 10th lines (text lines 1, 2, 7, and 9) are first-level titles that meet the conditions.
If the contestant uses a Windows system, the line breaks in the examples copied directly from the website or the issued problem statement are CRLF, which differs from the LF in the actual data. For ease of debugging, it is recommended to use the examples provided in the issued files for testing and to use file input and output directly.
Data Size and Constraints
The total text does not exceed 100 characters and 10 lines. The text only contains English letters, hash symbols (#), line feed (LF, $\n$), and spaces.
$$ \def\arraystretch{1.5} \begin{array}{|c|c|}\hline \bf{Test Point} & \bf{Text Special Properties} \\ \hline 1 & No blank characters \\\hline 2,3 & Only 1 line \\\hline 4,5 & / \\\hline \end{array} $$
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分