/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
英小文字からなる文字列 S が与えられます。
ここで、英小文字に含まれるドットの個数を以下のようにして定めます。
- 英小文字が
iまたはjであるとき : 1 個 - 英小文字が
i,jのいずれでもないとき : 0 個
S のすべての文字に対するドットの個数の和を求めてください。
制約
- S は長さ 1 以上 10 以下の英小文字からなる文字列
入力
入力は以下の形式で標準入力から与えられる。
S
出力
答えを出力せよ。
入力例 1
aiiaj
出力例 1
3
a, i, i, a, j に含まれるドットの個数はそれぞれ 0, 1, 1, 0, 1 です。
0 + 1 + 1 + 0 + 1 = 3 であるため、3 を出力します。
入力例 2
abcedfgh
出力例 2
0
入力例 3
jjjjjj
出力例 3
6
Score : 100 points
Problem Statement
You are given a string S consisting of lowercase English letters.
Here, we define the number of dots in a lowercase English letter as follows:
- If the lowercase English letter is
iorj: 1 dot - If the lowercase English letter is neither
inorj: 0 dots
Find the sum of the numbers of dots over all characters in S.
Constraints
- S is a string consisting of lowercase English letters with length between 1 and 10, inclusive.
Input
The input is given from Standard Input in the following format:
S
Output
Print the answer.
Sample Input 1
aiiaj
Sample Output 1
3
The numbers of dots in a, i, i, a, j are 0, 1, 1, 0, 1, respectively.
We have 0 + 1 + 1 + 0 + 1 = 3, so print 3.
Sample Input 2
abcedfgh
Sample Output 2
0
Sample Input 3
jjjjjj
Sample Output 3
6