KAMIL - Kamil

no tags 

Some kids cannot pronounce all letters, some of them they sometimes pronounce correctly and sometimes incorrectly. Kamil sometimes says T instead of K, but he never says K instead of T. Similarly he sometimes says D instead of G. Instead of R he sometimes says L and sometimes F. Of course it happens that he pronounces the letter correctly. Kamil's father always thinks how many words can mean the word spoken by his son (it doesn't matter if they are real English words).

Task

Write a program which

  • reads from standard input the words spoken by Kamil
  • counts how many different words can that mean
  • writes the outcome on standard output

 

Input

Ten test cases (given one under another, you have to process all!). Every test case is a single line - a word spoken by Kamil. Only 26 capital leters are used. The length of the word is at most 20.

Output

For every testcase write an integer in a single line with a single integer, denoting the number of words which Kamil's word can mean.

Score

The score awarded to your program is the number of bytes the source code you submit. The fewer points you score, the better. Submissions are not allowed to exceed 256 bytes.

Remark. It may turn out impossible to solve this problem in some languages.

Example

Input:
FILIPEK
[and 9 test cases more]

Output:
4
[and 9 test cases more]


hide comments
alexius_spoj: 2021-02-03 07:49:45

please make description clear, and dont truncate the input\output because it doesnt make sense to do it....

chingun55: 2021-01-03 09:22:02

i need help
pls

Last edit: 2021-01-03 09:22:32
shreyasz_07: 2020-11-23 19:31:24

please SPOJ clarify this question.

s_coders451: 2020-11-14 14:08:15

it says that :
Kamil sometimes says T instead of K, but he never says K instead of T. Similarly he sometimes says D instead of G. Instead of R he sometimes says L and sometimes F.
so according to the words it should be :
filipek
filipet
considering there is no 'r' present to be changed to f or l and we can't change f or l to r as mentioned then how come 4 please anyone explain.

Last edit: 2020-11-14 14:09:40
Rafail Loizou: 2020-11-13 03:53:41

160 in cpp can't get lower in cpp I think

[NG]: https://www.spoj.com/ranks/KAMIL/lang=CPP14

Last edit: 2020-11-15 04:03:05
teluguboy: 2020-01-23 10:08:37

Wtf? How is FILIPEK 4. when there are 8+1 permutations.

EDIT: For anybody doing this... The transformations are one-way. So he pronounces D as G, but he doesnt pronounce G as D. So, take G out of your test set, just like K.

FILIPEK

FIFIPEK
FIRIPEK
RILIPEK
RIFIPEK
RIRIPEK
LILIPEK
LIFIPEK
LIRIPEK

Last edit: 2020-01-23 10:30:50
mp_00a12: 2019-09-03 21:02:41

Did i misunderstand something or is example wrong?
It seems than letters other than K G L F may s well be blank spaces and the outcome will be the same, therefore FILIPEK = FLK
It has total of 8 permutations( flk flt rlt rrt rrk rlk frt frk)
Could someone tell me what is wrong with that way of thinking?

bnnj: 2019-08-05 19:36:31

134 in C... for now =)
edit: eh, 128.
edit: 121 !

Last edit: 2019-08-31 12:32:36
kamal_1998: 2019-06-27 11:08:39

166 in cpp

nagrahari: 2019-06-21 10:20:26

how score is added according to bytes?


Added by:Adam Dzedzej
Date:2004-06-08
Time limit:3s
Source limit:256B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: NODEJS OBJC PERL6 SQLITE VB.NET
Resource:Internet Contest Pogromcy Algorytmow (Algorithm Tamers) Round I, 2003