P25494 [AtCoder] [ABC029B] Counting 'r's
入门
题目描述

Problem Description

You are given 12 strings $ S_1 $, $ S_2 $, ..., $ S_{12} $ consisting of lowercase English letters.
Count the number of these strings that contain the character r.

Input Format

The input is given from the standard input in the following format:

$ S_1 $ $ S_2 $ : $ S_{12} $

  • On the $ i $-th line ($ 1 $ $ ≦ $ $ i $ $ ≦ $ $ 12 $), a string $ S_i $ consisting of lowercase English letters ($ 1 $ $ ≦ $ $ |S_i| $ $ ≦ $ $ 10 $) is given.
    All these strings are distinct.

Output Format

Output the number of strings among $ S_1 $, $ S_2 $, ..., $ S_{12} $ that contain the character r to the standard output, followed by a newline.
A string containing multiple rs should be counted only once.

Sample Input and Output

Sample Input #1

january
february
march
april
may
june
july
august
september
october
november
december

Sample Output #1

8

Sample Input #2

rrrrrrrrrr
srrrrrrrrr
rsr
ssr
rrs
srsrrrrrr
rssrrrrrr
sss
rrr
srr
rsrrrrrrrr
ssrrrrrrrr

Sample Output #2

11

Notes/Hints

Sample Explanation 1

The character r is contained in 8 strings: $ S_1 $, $ S_2 $, $ S_3 $, $ S_4 $, $ S_9 $, $ S_{10} $, $ S_{11} $, $ S_{12} $. Although $ S_2 $ contains r twice, it is counted only once.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
january february march april may june july august september october november december
样例输出
8