Time limit: 0.1s
Memory limit: 4MB
Input:
Output:
Task
You are given a string which contains only small lowercase letters. Find the minimum number of operations required such that will have the string roalgo
as a substring. The operation we are allowed to use is to replace one of the letters with another.
Input data
The first line will contain the given string .
Output data
The first line will contain an integer , the number of operations required to get the string roalgo
as a substring. If the substring is already present, print .
Constraints and clarifications
- , where is the length of .
Example
stdin
qaorxqlgp
stdout
3
Explanations
The minimal number of operations is (substring rxqlgp
can be transformed to roalgo
by replacing x
, q
and p
with the suitable letters.