import java.util.*; public class Main { public static void main (String[] args) throws Exception { int[] counts = new int[]{3, 2, 2, 2, 3, 2, 3, 2, 4, 3}; Scanner sc = new Scanner(System.in); char[] arr = sc.next().toCharArray(); int total = 1; for (int i = 0; i < arr.length; i++) { total += counts[arr[i] - '0']; } if (total == arr.length * 2 + 1) { total = arr.length + 2; } System.out.println(total); } }