Sphere Online Judge

SPOJ Problem Set (challenge)

53. Kamil

Problem code: KAMIL


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]


Added by:Adam Dzedzej
Date:2004-06-08
Time limit:3s
Source limit:256B
Memory limit:256MB
Cluster: Pyramid (Intel Pentium III 733 MHz)
Languages:All except: NODEJS PERL 6
Resource:Internet Contest Pogromcy Algorytmow (Algorithm Tamers) Round I, 2003

hide comments
2014-09-18 12:08:55 udaykiran
can any one tell me how output is 4
2014-08-02 23:33:48 Miroslav Kovar
Throws segfault on the server, runs fine locally... Why?
2014-06-29 00:39:11 Rachit Saxena
hahaha still laughing on this :P

i removed all identation all spaces
int main(){........}
:P
n every time i reduces a space score decreases means its good :P :)
hell of a question =D
2014-06-23 21:51:33 rick
nicely works in dev cpp
but is >256 B ! what do?

Last edit: 2014-06-23 21:52:27
2014-05-30 10:06:11 rohan
exceeding time limit ... no idea why!!!
2014-02-21 20:51:43 Kamil
wow my name is kamil :)
Edit : really??

Last edit: 2014-04-24 21:45:53
2014-01-17 07:55:50 Anubhav Balodhi
@Yashvir how about 68 char in python...
2014-01-16 19:36:18 Yashvir Singh
done in 21 char in awk after so many tries

Last edit: 2014-01-16 19:36:49
2013-12-28 04:57:24 Samil Vargas
plz some testcases someone
2013-12-27 00:36:30 Chien-Mao Chen
@Virat Goyal: Sure, I passed it by JAVA.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.