Problem:
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

Solution in Java7 (OpenJDK 1.7.0) (judge verdict: Wrong Answer)

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		final String b = "CODEFESTIVAL2016";
		
		int dp[][] = new int[20][20];
		for(int i=0; i<=16; i++) {
			dp[0][i] = i;
			dp[i][0] = i;
		}
		
		for(int i=1; i<=16; i++) {
			for(int j=1; j<=16; j++) {
				int f = 0;
				if(a.charAt(i-1) != b.charAt(j-1))
					f = 1;
				
				//int l1 = dp[i][j-1] + 1;
				int l2 = dp[i-1][j] + 1;
				int l3 = dp[i-1][j-1] + f;
				
				dp[i][j] = Math.min(l2, l3);
			}
		}
		
		System.out.println(dp[16][16]);

	}

}