Time Limit: 2 sec / Memory Limit: 256 MB
配点 : 100 点
問題文
CODE FESTIVAL 2016が開催されます。開催にあたって、高橋君はCODE FESTIVAL 2016の看板を作ることにしました。
看板にはCODEFESTIVAL2016
と書きたかったのですが、高橋君は間違えて異なる文字列Sを書いてしまいました。幸い、書いた文字列の長さは間違っていませんでした。
そこで高橋君は、ある文字を別の文字に書き換えるという操作を最小の回数行って、この文字列をCODEFESTIVAL2016
に書き換えることにしました。
書き換えの回数の最小値を求めてください。
制約
- Sの長さは16である。
- S は英大文字、英小文字、数字からなる。
入力
入力は以下の形式で標準入力から与えられる。
S
出力
書き換えの回数の最小値を表す整数を出力せよ。
入力例 1
C0DEFESTIVAL2O16
出力例 1
2
2文字目の0
をO
に、14文字目のO
を0
に書き換える必要があります。
入力例 2
FESTIVAL2016CODE
出力例 2
16
Score : 100 points
Problem Statement
CODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.
He intended to write CODEFESTIVAL2016
on it, but he mistakenly wrote a different string S. Fortunately, the string he wrote was the correct length.
So Mr. Takahashi decided to perform an operation that replaces a certain character with another in the minimum number of iterations, changing the string to CODEFESTIVAL2016
.
Find the minimum number of iterations for the rewrite operation.
Constraints
- S is 16 characters long.
- S consists of uppercase and lowercase alphabet letters and numerals.
Input
Inputs are provided from Standard Input in the following form.
S
Output
Output an integer representing the minimum number of iterations needed for the rewrite operation.
Sample Input 1
C0DEFESTIVAL2O16
Sample Output 1
2
The second character 0
must be changed to O
and the 14th character O
changed to 0
.
Sample Input 2
FESTIVAL2016CODE
Sample Output 2
16