P10664 [HackerEarth] bhargav and gre
普及
题目描述

bhargav has dream to study his MS is foreign country. So, He started his preparation for GRE. There are huge number of words that he has to prepare for. So, firs he wanted to group all synonyms and antonyms. As there are huge number of words that he has to group. So, he asked help to group all synonyms and antonyms of a word.
it is called antonym if the first letter of a current number is 3 steps upper than reference then it is antonym if the first letter of the reference number is same as the current first letter of a word then it is synonym. and the length should be same for the antonym and synonym

INPUT:
first line should contain a word W.
next line contains no of words N.
next N lines consists of words that are to be grouped.

OUTPUT
print no of synonyms S followed by antonyms A.

SAMPLE INPUT
hasrfk
4
heyfgs
jhajyrbf
kayufs
hetinf

SAMPLE OUTPUT
2 1

输入格式

见题面

输出格式

见题面

样例输入
hasrfk 4 heyfgs jhajyrbf kayufs hetinf SAMPLE
样例输出
2 1