COCI '08 Contest 5 #1 Ljesnjak

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 32M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Not so long ago, before operating systems were as powerful as they are today, computers (which often had turbo buttons on the exterior) couldn't handle certain letters of the Croatian alphabet. Programmers agreed to use two or three-letter substitutions as in this table:

Letter Characters
č c=
ć c-
dz=
đ d-
lj lj
nj nj
š s=
ž z=

For example, the word ljes=njak consists of six letters in the Croatian alphabet: lj, e, š, nj, a, k. Write a program that calculates the number of letters in the given word.

Input Specification

The first line contains a string of at most 100 characters. Only lowercase letters of the English alphabet and characters - and = will appear.

The string will represent a word encoded as described above.

Output Specification

Output the number of letters in the input word.

Sample Input 1

dz=ak

Sample Output 1

3

Sample Input 2

ljes=njak

Sample Output 2

6

Comments


  • 0
    Paradox  commented on Aug. 14, 2017, 4:50 p.m.

    There is a typo in the table.
    c and d should be c- and d-.


    • 0
      Pleedoh  commented on Aug. 14, 2017, 9:46 p.m.

      Well that's quite important. First ever JS submission I've seen too.


      • 0
        Kirito  commented on Aug. 14, 2017, 9:54 p.m.

        Table has been corrected.