package yukicoder; import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; public class No509 { public static void main(String[] args) { String n = new Scanner(System.in).next(); char[] nC = n.toCharArray(); HashSet more1 = new HashSet<>(); int cnt; cnt = n.length() + 1; more1.addAll(Arrays.asList('0', '4', '6', '9')); for(char each : nC) { if( more1.contains(each) ) cnt++; if(each == '8') cnt += 2; } cnt += n.length(); System.out.println(cnt); } }