Mock CCC '19 Contest 1 J2 - Pusheen OCR

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

Pusheen is organizing a party for her friends! She is producing signed cards and giving them to all of her friends. She decides to take pictures of them to archive later. The OCR on Pusheen's smartphone transcribed most of the card properly, but due to the nature of signatures, the OCR might have mangled her name. Help Pusheen figure out how many errors the OCR made!

The OCR produced a string S of length 7. This string should be compared character by character with pusheen, and the number of errors is the number of indices where the OCR'ed string does not match with pusheen.

Constraints

S will have length exactly 7.

S will only have letters that can be found in pusheen.

In tests worth 14 marks, the correct letters in the OCR will form a prefix of the string.

Input Specification

The first and only line of input contains a string S, the string that the OCR produced.

Output Specification

Output, on a single line, the number of errors in the string.

Sample Input

pusheen

Sample Output

0

Sample Explanation

In this example, the OCR worked properly and there were no errors!

Sample Input

neehsup

Sample Output

6

Sample Explanation

In this example, the OCR somehow reversed Pusheen's name! Only the h is in the correct location, so there are 6 errors.


Comments

There are no comments at the moment.